1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

18 commits

Author SHA1 Message Date
Santiago Pastorino
ab2bde45f8 Remove require AS::Concern from places where is already in 2010-12-19 19:15:26 -02:00
Emilio Tagua
dc2f26ca38 Perf: refactor methods using inject when not need in activemodel.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-22 18:08:03 -03:00
Santiago Pastorino
b451de0d6d Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;) 2010-08-14 04:12:33 -03: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
1a6d76223b expanding on the will_change! method in documentation 2010-07-29 09:18:29 -04:00
Rizwan Reza
de65c82bfa Changes call backs to callbacks. 2010-06-15 22:48:10 +04:30
Rizwan Reza
716c243def Minor changes to active_model/callbacks.rb and dirty.rb 2010-06-14 13:38:29 +04:30
Federico Brubacher
6b4e0cc526 a cloned object no longer mimics changed flags from creator , plus a test case [#4614 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-16 23:04:40 +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
Xavier Noria
3b1c69d2dd adds a few requires in active_model/dirty.rb
[#4284 state:committed]
2010-03-28 12:43:20 +02:00
Jeremy Kemper
c3cea9b594 Fix unstated dep on HWIA 2010-03-27 11:03:36 -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
Aaron Patterson
df735cf5b7 fisting uninitialized ivar warnings. [#4198 state:resolved]
Signed-off-by: wycats <wycats@gmail.com>
2010-03-16 15:11:00 -07:00
Aaron Patterson
8c3e46c093 clean up more warnings, remove unnecessary methods, fix eval line numbers. [#4193 state:resolved]
Signed-off-by: wycats <wycats@gmail.com>
2010-03-16 11:48:34 -07:00
Pratik Naik
dba196cb7f Merge docrails 2010-01-17 03:26:20 +05:30
Josh Sharpe
80989437dc I added this feature so that a Map of changed fields could be retrieved
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>
2009-08-31 12:50:27 -05:00
Joshua Peek
f97dae5ebe Extract common dirty tracking methods in AMo 2009-08-10 13:51:48 -05:00