Module: PushType::Trashable

Extended by:
ActiveSupport::Concern
Included in:
Asset, Node
Defined in:
app/models/concerns/push_type/trashable.rb

Instance Method Summary collapse

Instance Method Details

#restore!Object



14
15
16
# File 'app/models/concerns/push_type/trashable.rb', line 14

def restore!
  update_attribute :deleted_at, nil
end

#trash!Object



10
11
12
# File 'app/models/concerns/push_type/trashable.rb', line 10

def trash!
  update_attribute :deleted_at, Time.zone.now
end

#trashed?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'app/models/concerns/push_type/trashable.rb', line 18

def trashed?
  deleted_at.present?
end