Module: Undeletable::ClassMethods
- Defined in:
- lib/undeletable.rb
Instance Method Summary collapse
- #delete(id_or_array) ⇒ Object
- #delete_all(conditions = nil) ⇒ Object
- #raise_on_delete? ⇒ Boolean
- #undeletable? ⇒ Boolean
Instance Method Details
#delete(id_or_array) ⇒ Object
22 23 24 25 |
# File 'lib/undeletable.rb', line 22 def delete(id_or_array) raise ActiveRecord::ReadOnlyRecord.new("#{self} is undeletable") if raise_on_delete? logger.debug("will not #{self}.delete #{id_or_array.inspect}", e) if Undeletable.debug end |
#delete_all(conditions = nil) ⇒ Object
27 28 29 30 |
# File 'lib/undeletable.rb', line 27 def delete_all(conditions = nil) raise ActiveRecord::ReadOnlyRecord.new("#{self} is undeletable") if raise_on_delete? logger.debug("will not #{self}.delete_all", e) if Undeletable.debug end |
#raise_on_delete? ⇒ Boolean
18 19 20 |
# File 'lib/undeletable.rb', line 18 def raise_on_delete? self.raise_on_delete end |
#undeletable? ⇒ Boolean
14 15 16 |
# File 'lib/undeletable.rb', line 14 def undeletable? true end |