Module: Golden::DeletedAtConcern

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

Instance Method Summary collapse

Instance Method Details

#deleted?Boolean

Returns:

  • (Boolean)


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

def deleted?
  deleted_at?
end

#soft_destroy!Object



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

def soft_destroy!
  update deleted_at: Time.zone.now
end

#undeleted?Boolean

Returns:

  • (Boolean)


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

def undeleted?
  !deleted?
end