Module: Hub::SoftDelete
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/models/concerns/hub/soft_delete.rb
Instance Method Summary collapse
Instance Method Details
#deleted? ⇒ Boolean
23 24 25 |
# File 'app/models/concerns/hub/soft_delete.rb', line 23 def deleted? deleted_at.present? end |
#destroy ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/models/concerns/hub/soft_delete.rb', line 11 def destroy run_callbacks(:destroy) do if persisted? t = Time.now.utc update_columns(deleted_at: t, updated_at: t) end @destroyed = true end freeze end |