| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
model.name_changed?(from: "Pete", to: "Ringo")
|
|\
| |
| |
| |
| |
| |
| | |
Updated DirtyModel's @changed_attributes hash to be symbol/string agnostic
Conflicts:
activemodel/CHANGELOG.md
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
of an instance. When using the attribute_will_change! method, you must
supply a string and not a symbol or the *_changed? method will break
(because it is looking for the attribute name as a string in the keys
of the underlying hash). To remedy this, I simply made the underlying
hash a HashWithIndifferentAccess so it won't matter if you supply
the attribute name as a symbol or string to attribute_will_change!.
|
| |
| |
| |
| | |
Make AM::Dirty less dirty to plugin into AR or other library
|
|/
|
|
|
|
|
| |
* Clarifying what the #changed method returns
* Adding tests to describe what the #changed_attributes returns
* Updating test name based on pull request comment
* Moving the test lower in the file per pull request comment
|
|
|
|
|
|
|
|
|
|
|
| |
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
~~~
|
| |
|
| |
|
|
|
|
|
|
| |
state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
|
|
| |
[#4645 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
|
|
|
|
| |
expectation on including class' initialize method.
[#4308 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
| |
|
|
state:resolved]
Keep the Rails style of inject
Signed-off-by: José Valim <jose.valim@gmail.com>
|