Module | Cms::Behaviors::SoftDeleting::ClassMethods |
In: |
lib/cms/behaviors/soft_deleting.rb
|
# File lib/cms/behaviors/soft_deleting.rb, line 30 30: def count(*args) 31: not_deleted.count_with_deleted(*args) 32: end
# File lib/cms/behaviors/soft_deleting.rb, line 33 33: def delete_all(conditions=nil) 34: update_all(["deleted = ?", true], conditions) 35: end
# File lib/cms/behaviors/soft_deleting.rb, line 36 36: def exists?(id_or_conditions) 37: if id_or_conditions.is_a?(Hash) || id_or_conditions.is_a?(Array) 38: conditions = {:conditions => id_or_conditions} 39: else 40: conditions = {:conditions => {:id => id_or_conditions}} 41: end 42: count(conditions) > 0 43: end