Method: Challah::UserStatusable#active=

Defined in:
lib/challah/concerns/user/statusable.rb

#active=(enabled) ⇒ Object

Fallback to pre-enum active column (pre challah 1.4)



18
19
20
21
22
23
24
# File 'lib/challah/concerns/user/statusable.rb', line 18

def active=(enabled)
  if self.class.columns.map(&:name).include?("status")
    self.status = (!!enabled ? :active : :inactive)
  else
    write_attribute(:active, !!enabled)
  end
end