Module: Polivalente::Trashable

Extended by:
ActiveSupport::Concern
Includes:
Discard::Model
Defined in:
app/models/concerns/polivalente/trashable.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#place_in_trash!Object



19
20
21
# File 'app/models/concerns/polivalente/trashable.rb', line 19

def place_in_trash!
  Trash.create(user: self.user, trashable: self)
end

#remove_from_trash!Object



23
24
25
# File 'app/models/concerns/polivalente/trashable.rb', line 23

def remove_from_trash!
  Trash.find_by(user: self.user, trashable: self).destroy!
end