Commit Graph

8 Commits

Author SHA1 Message Date
Renato Mascarenhas
cf7ab6056a Reset attributes should not report changes.
When resetting an attribute, you expect it to return to the state it was
before any changes. Namely, this fixes this unexpected behavior:

~~~ruby
model.name = "Bob"
model.reset_name!
model.name_changed? #=> true
~~~
2012-12-01 16:58:09 -02:00
Francesco Rodriguez
00c94d7d94 updating define_attribute_methods documentation 2012-05-14 11:38:23 -05:00
Ian Stewart
eafa174bfd changing an attribute multiple times retains the correct original value 2011-06-28 22:18:24 -07:00
Tore Darell
2c8a4a53a8 Remove or fix non-working examples and add a few tests to Dirty [#5185 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-08-03 10:47:30 +02:00
Neeraj Singh
b462952886 Use better assertion methods for testing
[#4645 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-19 10:18:36 +02:00
Sam Pohlenz
3adaef8ae7 Restore changed_attributes method in ActiveModel::Dirty and loosen expectation on including class' initialize method.
[#4308 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-01 17:52:45 -07:00
José Valim
f1da7174cc Fix tests added in previous commit. 2010-03-27 11:04:21 +01:00
Jacob Atzen
a5d637d86c ActiveModel::Dirty#changes should return a HashWithIndifferentAccess [#4157 state:resolved]
Keep the Rails style of inject

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-03-27 10:48:32 +01:00