Module: SoftTrash::Model::ClassMethods

Defined in:
lib/soft_trash/model.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#restore_allObject

Person.where(age: 0..18).restore_all



41
42
43
# File 'lib/soft_trash/model.rb', line 41

def restore_all
  deleted.each(&:restore)
end

#restore_all!Object

Person.where(age: 0..18).restore_all!



47
48
49
# File 'lib/soft_trash/model.rb', line 47

def restore_all!
  deleted.each(&:restore!)
end

#trash_allObject

Person.where(age: 0..18).trash_all



27
28
29
# File 'lib/soft_trash/model.rb', line 27

def trash_all
  active.each(&:trash)
end

#trash_all!Object

Person.where(age: 0..18).trash_all!



34
35
36
# File 'lib/soft_trash/model.rb', line 34

def trash_all!
  active.each(&:trash!)
end