Module: ActAsDirty::ActiveRecord::Cleans
Instance Method Summary
collapse
#dirt, #read_changes_for_cleaning
Instance Method Details
#clean?(context = nil) ⇒ Boolean
12
13
14
15
16
|
# File 'lib/act_as_dirty/active_record/cleans.rb', line 12
def clean?(context = nil)
context ||= (new_record? ? :create : :update)
output = super(context)
dirt.empty? && output
end
|
#dirty?(context = nil) ⇒ Boolean
18
19
20
|
# File 'lib/act_as_dirty/active_record/cleans.rb', line 18
def dirty?(context = nil)
!clean?(context)
end
|
#save(options = {}) ⇒ Object
7
8
9
10
|
# File 'lib/act_as_dirty/active_record/cleans.rb', line 7
def save(options={})
perform_cleanings(options)
super
end
|