aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods/dirty.rb
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #3544 from amatsuda/_field_changedAaron Patterson2012-09-211-3/+3
| | | | | | | | Rename field_changed? to _field_changed? so that users can create a field named field Conflicts: activerecord/lib/active_record/core.rb activerecord/test/cases/dirty_test.rb
* Do not consider the numeric attribute as changed if the old value isRafael Mendonça França2012-08-021-1/+1
| | | | | | | | | | | | | | | | | | | | zero and the new value is not a string. Before this commit this was the behavior r = Review.find_by_issue(0) r.issue => 0 r.changes => {} r.issue = 0 => 0 r.changed? => true r.changes => {"issue"=>[0,0]} Fixes #7237
* Merge branch 'acapilleri-update_nested_attributes'Rafael Mendonça França2012-06-211-5/+15
| | | | | | | Closes #6675 Conflicts: activerecord/lib/active_record/attribute_methods/dirty.rb
* fix indentJon Leighton2011-11-301-3/+3
|
* Merge remote branch 'rails/master' into identity_mapEmilio Tagua2010-12-201-1/+2
|\ | | | | | | | | | | | | | | Conflicts: activerecord/lib/active_record/associations/association_proxy.rb activerecord/lib/active_record/autosave_association.rb activerecord/lib/active_record/base.rb activerecord/lib/active_record/persistence.rb
| * class inheritable attributes is used no more! all internal use of class ↵Josh Kalderimis2010-11-201-1/+2
| | | | | | | | | | | | inheritable has been changed to class_attribute. class inheritable attributes has been deprecated. Signed-off-by: José Valim <jose.valim@gmail.com>
* | Remove objects from identity map if save! failed, otherwise finding again ↵Emilio Tagua2010-11-191-0/+3
| | | | | | | | the same record will have invalid attributes.
* | Remove objects from identity map if save failed, otherwise finding again the ↵Emilio Tagua2010-11-191-0/+2
|/ | | | same record will have invalid attributes.
* Make should_record_timestamps? serialization aware rather than object#changed?Pratik Naik2010-11-021-4/+0
|
* Ensure save always updates timestamps when serialized attributes are presentPratik Naik2010-11-021-0/+4
|
* Replacing superclass_delegating_accessoror with class_attribute.Neeraj Singh2010-08-311-1/+1
| | | | | | | :partial_attributes will have value true or false so there is no danger of mutability here. Signed-off-by: José Valim <jose.valim@gmail.com>
* Make sure timestamp is properly referencedBlake Smith2010-05-111-1/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* eliminate alias_method_chain from ActiveRecordwycats2010-05-091-50/+50
|
* Dirty datetime attributes should be aware of time zone info [#3658 ↵Kristopher Murata2010-04-081-0/+6
| | | | | | state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* adds missing requires for Object#blank? and Object#present?Xavier Noria2010-03-281-0/+2
|
* fisting uninitialized ivar warnings. [#4198 state:resolved]Aaron Patterson2010-03-161-8/+8
| | | | Signed-off-by: wycats <wycats@gmail.com>
* clean up more warnings, remove unnecessary methods, fix eval line numbers. ↵Aaron Patterson2010-03-161-1/+1
| | | | | | [#4193 state:resolved] Signed-off-by: wycats <wycats@gmail.com>
* Object#tap is not needed for Ruby >= 1.8.7Xavier Noria2009-11-091-2/+0
|
* I added this feature so that a Map of changed fields could be retrievedJosh Sharpe2009-08-311-2/+9
| | | | | | | | | | | | | | | | | | | | after a model had been saved. This is useful in the after_save callback when you need to know what fields changed. At present there is no way to do this other than have code in the before_save callback that takes a copy of the changes Map, which I thought was a bit messy. Example. person = Person.find_by_name('bob') person.name = 'robert' person.changes # => {'name' => ['bob, 'robert']} person.save person.changes # => {} person.previous_changes # => {'name' => ['bob, 'robert']} person.reload person.previous_changes # => {} Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Extract common dirty tracking methods in AMoJoshua Peek2009-08-101-114/+9
|
* AMo overrides alias_attribute and manages aliasing all known attribute ↵Joshua Peek2009-08-101-17/+0
| | | | method matchers
* Serialized attributes should only be saved with partial_updates when the ↵Mike Breen2009-08-091-1/+1
| | | | | | serialized attribute is present [#2397 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Added reset_attribute! method to ActiveRecord::AttributeMethods::Dirty which ↵Paul Gillard2009-08-041-12/+29
| | | | | | will reset an attribute to its original value should it have changed. Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Concernify AR AttributeMethodsJoshua Peek2009-07-301-0/+187