Module: Golden::DisabledAtConcern

Extended by:
ActiveSupport::Concern
Defined in:
lib/golden/active_record_concerns/disabled_at_concern.rb

Instance Method Summary collapse

Instance Method Details

#disable!Object



12
13
14
# File 'lib/golden/active_record_concerns/disabled_at_concern.rb', line 12

def disable!
  update disabled_at: Time.zone.now
end

#disabled?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/golden/active_record_concerns/disabled_at_concern.rb', line 20

def disabled?
  disabled_at?
end

#enable!Object



16
17
18
# File 'lib/golden/active_record_concerns/disabled_at_concern.rb', line 16

def enable!
  update disabled_at: nil
end

#enabled?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/golden/active_record_concerns/disabled_at_concern.rb', line 24

def enabled?
  !disabled?
end