Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | When applying changes or reseting changes create the right class | Rafael Mendonça França | 2014-01-20 | 1 | -3/+3 | |
| | | | | | | | Before this patch after the changes are applied the changes can be only accessed using string keys, but before symbols are also accepted. After this change every state of the model will be consistent. | |||||
* | Allows you to check if an attribute has changed to a particular value | Tejas Dinkar | 2013-12-15 | 1 | -2/+6 | |
| | | | | model.name_changed?(from: "Pete", to: "Ringo") | |||||
* | Added :nodoc: for `attribute_changed?` and `attribute_was` [ci skip] | Godfrey Chan | 2013-12-12 | 1 | -2/+2 | |
| | | | | | | These methods were made "public" in 47617ecd so that `method_missing` can invoke them without going through `send`, but they aren't meant for consumption from outside of Rails. | |||||
* | Merge pull request #8791 from griffinmyers/master | Rafael Mendonça França | 2013-10-03 | 1 | -1/+1 | |
|\ | | | | | | | | | | | | | Updated DirtyModel's @changed_attributes hash to be symbol/string agnostic Conflicts: activemodel/CHANGELOG.md | |||||
| * | DirtyModel uses a hash to keep track of any changes made to attributes | William Myers | 2013-05-27 | 1 | -1/+1 | |
| | | | | | | | | | | | | | | | | | | 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!. | |||||
* | | Fix the documentation method. | Rafael Mendonça França | 2013-09-23 | 1 | -1/+1 | |
| | | | | | | | | | | | | It is reload! in the class definition. [ci skip] | |||||
* | | Document reset_changes since it is part of public API | Rafael Mendonça França | 2013-09-23 | 1 | -0/+12 | |
| | | | | | | | | [ci skip] | |||||
* | | Merge pull request #10816 from bogdan/less-dirty-dirty | Rafael Mendonça França | 2013-09-23 | 1 | -10/+16 | |
| | | | | | | | | Make AM::Dirty less dirty to plugin into AR or other library | |||||
* | | expose a few attribute changed methods | Aaron Patterson | 2013-06-11 | 1 | -10/+10 | |
| | | ||||||
* | | Convert ActiveModel to 1.9 hash syntax. | Patrick Robertson | 2013-05-01 | 1 | -1/+1 | |
| | | | | | | | | | | I also attempted to fix other styleguide violations such as { a: :b } over {a: :b} and foo(b: 'bar') over foo( b: 'bar' ). | |||||
* | | Prefer find_by over dynamic finders in rdoc | Sam Ruby | 2013-04-02 | 1 | -1/+1 | |
| | | ||||||
* | | Revert "Merge pull request #8989 from robertomiranda/use-rails-4-find-by" | Guillermo Iguaran | 2013-01-18 | 1 | -1/+1 | |
| | | | | | | | | | | This reverts commit 637a7d9d357a0f3f725b0548282ca8c5e7d4af4a, reversing changes made to 5937bd02dee112646469848d7fe8a8bfcef5b4c1. | |||||
* | | User Rails 4 find_by | robertomiranda | 2013-01-18 | 1 | -1/+1 | |
|/ | ||||||
* | Namespace HashWithIndifferentAccess | Akira Matsuda | 2013-01-07 | 1 | -1/+1 | |
| | ||||||
* | Reset attributes should not report changes. | Renato Mascarenhas | 2012-12-01 | 1 | -1/+4 | |
| | | | | | | | | | | | 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 ~~~ | |||||
* | cleanup, removed dispensable `require` statements from `ActiveModel` | Yves Senn | 2012-11-25 | 1 | -1/+0 | |
| | ||||||
* | minor edits in AM documentation [ci skip] | Francesco Rodriguez | 2012-10-21 | 1 | -1/+1 | |
| | ||||||
* | load active_support/core_ext/object/blank in active_support/rails | Xavier Noria | 2012-08-02 | 1 | -1/+0 | |
| | ||||||
* | update ActiveModel::Errors documentation and minor fixes [ci skip] | Francesco Rodriguez | 2012-06-22 | 1 | -3/+3 | |
| | ||||||
* | update ActiveModel::Dirty documentation | Francesco Rodriguez | 2012-05-31 | 1 | -24/+35 | |
| | ||||||
* | updating define_attribute_methods documentation | Francesco Rodriguez | 2012-05-14 | 1 | -1/+1 | |
| | ||||||
* | Merge branch 'master' of github.com:lifo/docrails | Vijay Dev | 2012-05-01 | 1 | -0/+1 | |
|\ | ||||||
| * | Add line which gives a little bit more information how *_will_change! works. | Edward Tsech | 2012-05-01 | 1 | -0/+1 | |
| | | ||||||
* | | Return earlier if attribute already changed in *_will_change! methods | Carlos Antonio da Silva | 2012-04-27 | 1 | -1/+3 | |
|/ | | | | Avoid obtaining the value and duplicating it when possible. | |||||
* | Changing active model dirty module helper method to more appropriate method ↵ | Prasath Venkatraman | 2012-02-06 | 1 | -1/+2 | |
| | | | | | | | | with helper #4903 Changing active model dirty module helper method to more appropriate method with helper with Active Support Helper #4903 Changing active model dirty module helper method to more appropriate method with helper with Active Support Helper typo fixed #4903 | |||||
* | use any? instead of !empty? | Oscar Del Ben | 2011-11-14 | 1 | -1/+1 | |
| | ||||||
* | Fix typo in ActiveModel::Dirty comment. define_attribute_methods is a class ↵ | Josh Nesbitt | 2011-09-02 | 1 | -1/+1 | |
| | | | | method, not attribute. | |||||
* | Documentation fix: adding missing equal sign in code sample for ↵ | Sebastian Gassner | 2011-07-20 | 1 | -1/+1 | |
| | | | | ActiveModel::Dirty. | |||||
* | changing an attribute multiple times retains the correct original value | Ian Stewart | 2011-06-28 | 1 | -1/+1 | |
| | ||||||
* | Rephrased Dirty#changed? docs | Sebastian Martinez | 2011-04-26 | 1 | -1/+1 | |
| | ||||||
* | Rewording | Oge Nnadi | 2011-04-11 | 1 | -1/+1 | |
| | ||||||
* | Remove require AS::Concern from places where is already in | Santiago Pastorino | 2010-12-19 | 1 | -1/+0 | |
| | ||||||
* | Perf: refactor methods using inject when not need in activemodel. | Emilio Tagua | 2010-09-22 | 1 | -1/+1 | |
| | | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com> | |||||
* | Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵ | Santiago Pastorino | 2010-08-14 | 1 | -18/+18 | |
| | | | | 's/[ \t]*$//' -i {} \;) | |||||
* | Remove or fix non-working examples and add a few tests to Dirty [#5185 ↵ | Tore Darell | 2010-08-03 | 1 | -7/+2 | |
| | | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com> | |||||
* | expanding on the will_change! method in documentation | Neeraj Singh | 2010-07-29 | 1 | -1/+4 | |
| | ||||||
* | Changes call backs to callbacks. | Rizwan Reza | 2010-06-15 | 1 | -1/+1 | |
| | ||||||
* | Minor changes to active_model/callbacks.rb and dirty.rb | Rizwan Reza | 2010-06-14 | 1 | -6/+11 | |
| | ||||||
* | a cloned object no longer mimics changed flags from creator , plus a test ↵ | Federico Brubacher | 2010-05-16 | 1 | -4/+5 | |
| | | | | | | case [#4614 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com> | |||||
* | Restore changed_attributes method in ActiveModel::Dirty and loosen ↵ | Sam Pohlenz | 2010-04-01 | 1 | -12/+12 | |
| | | | | | | | | expectation on including class' initialize method. [#4308 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net> | |||||
* | adds a few requires in active_model/dirty.rb | Xavier Noria | 2010-03-28 | 1 | -0/+3 | |
| | | | | [#4284 state:committed] | |||||
* | Fix unstated dep on HWIA | Jeremy Kemper | 2010-03-27 | 1 | -0/+2 | |
| | ||||||
* | Fix tests added in previous commit. | José Valim | 2010-03-27 | 1 | -0/+5 | |
| | ||||||
* | ActiveModel::Dirty#changes should return a HashWithIndifferentAccess [#4157 ↵ | Jacob Atzen | 2010-03-27 | 1 | -1/+1 | |
| | | | | | | | | state:resolved] Keep the Rails style of inject Signed-off-by: José Valim <jose.valim@gmail.com> | |||||
* | fisting uninitialized ivar warnings. [#4198 state:resolved] | Aaron Patterson | 2010-03-16 | 1 | -10/+7 | |
| | | | | Signed-off-by: wycats <wycats@gmail.com> | |||||
* | clean up more warnings, remove unnecessary methods, fix eval line numbers. ↵ | Aaron Patterson | 2010-03-16 | 1 | -9/+2 | |
| | | | | | | [#4193 state:resolved] Signed-off-by: wycats <wycats@gmail.com> | |||||
* | Merge docrails | Pratik Naik | 2010-01-17 | 1 | -1/+39 | |
| | ||||||
* | I added this feature so that a Map of changed fields could be retrieved | Josh Sharpe | 2009-08-31 | 1 | -0/+14 | |
| | | | | | | | | | | | | | | | | | | | | 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 AMo | Joshua Peek | 2009-08-10 | 1 | -0/+112 | |