| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, when `time_zone_aware_attributes` were enabled, after
changing a datetime or timestamp attribute and then changing it back
to the original value, `changed_attributes` still tracked the
attribute as changed. This caused `[attribute]_changed?` and
`changed?` methods to return true incorrectly.
Example:
in_time_zone 'Paris' do
order = Order.new
original_time = Time.local(2012, 10, 10)
order.shipped_at = original_time
order.save
order.changed? # => false
# changing value
order.shipped_at = Time.local(2013, 1, 1)
order.changed? # => true
# reverting to original value
order.shipped_at = original_time
order.changed? # => false, used to return true
end
(cherry picked from commit bc982cbcb34129ea2cfe8aa1f8e0b40e444e68db)
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
Backport of #9073
Fixes #8898
|
|
|
|
|
|
|
|
|
| |
This reverts commit 8905c1fb496641c3cdb7b3b816ae6d3d4b2c2b73.
Closes #8460
Conflicts:
activerecord/test/cases/dirty_test.rb
|
|
|
|
| |
Add a test case to ensure that fractional second updates are detected.
|
|
|
|
|
|
|
|
|
|
|
| |
Don't call will_change! for datetime nil->"".
Setting a nil datetime attribute to a blank string should not cause the
attribute to be dirty.
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 0693e079708a52b777f2b7872b8e3d467b880a0d.
Revert "Cache columns metadata to avoid extra while testing"
This reverts commit a82f1e3f5d11c8dfba9f4c911745ec40a7965216.
Reason: This is causing failures in the postgresql build.
See http://travis-ci.org/#!/rails/rails/builds/2485584
Related with #7675
|
| |
|
|
|
|
|
|
|
| |
Fix #6975. Round usec when writing timestamp attribute.
Conflicts:
activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
|
|
|
|
|
|
|
|
|
|
|
|
| |
Revert "Deprecate update_attribute."
This reverts commit b081f6b59fb3f15d12043072ad9b331ffd2bc56e.
Reason: Since the new deprecation policy we removed the deprecation of
update_attribute but we didn't reverted the changes to use
update_column.
Fixes #7306
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Before b081f6b59fb3f15d12043072ad9b331ffd2bc56e, this test are
asserting that update_attribute does the dirty tracking. Since we
deprecated this method and update_column write in the database directly
this tests will always fail.
|
|
|
|
|
|
|
|
|
|
|
| |
Historically, update_attribute and update_attributes are similar, but
with one big difference: update_attribute does not run validations.
These two methods are really easy to confuse given their similar
names. Therefore, update_attribute is being deprecated in favor of
update_column, and will be removed in Rails 4.
See the discussion on rails-core here:
https://groups.google.com/d/topic/rubyonrails-core/BWPUTK7WvYA/discussion
|
| |
|
| |
|
|
|
|
| |
RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
|
|
|
|
| |
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
|
|
|
|
|
|
| |
This reverts commit 45c233ef819dc7b67e259dd73f24721fec28b8c8.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
|
|
|
|
| |
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
|
| |
|
| |
|
|
|
|
| |
's/[ \t]*$//' -i {} \;)
|
|
|
|
| |
intrinsic to its implementation.
|
|
|
|
|
|
|
|
|
|
| |
- it will only save the attribute it has been asked to save and not all dirty attributes
- it does not invoke callbacks
- it does change updated_at/on
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
|
|
| |
[#4645 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
|
|
| |
case [#4614 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
|
|
| |
state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
serialized attribute is present [#2397 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
|
|
|
|
|
|
| |
will reset an attribute to its original value should it have changed.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
|
|
|
|
| |
[#1617 state:resolved]
|
|
|
|
|
|
|
|
| |
ActionPack
Signed-Off-By: Michael Koziarski <michael@koziarski.com>
[#1202 state:committed]
|
|
|
|
|
|
| |
state:resolved]
Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
|
|
|
|
|
|
|
| |
columns, NULL gets stored in database for blank (i.e. '') values. Only integer columns were considered.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1692 state:committed]
|
|
|
|
|
|
|
|
| |
column is changed from 0 to '0'
[#1530 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
|
|
|
|
|
|
| |
attributes.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#812 state:committed]
|
|
|
|
|
|
| |
[#798 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
|
|
|
|
|
|
| |
turned on.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#788 state:committed]
|
|
|
|
| |
state:resolved]
|
|
|
|
| |
state:resolved]
|
|
|
|
| |
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
|
|
|
|
| |
[#150 state:resolved] [Jason Dew, Pratik]
|
|
|
|
| |
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
|
|
|
| |
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9159 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|
|
|
|
|
|
| |
YourClass.partial_updates = true to enable.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9157 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|
|
|
|
|
|
| |
#11464 [Russell Norris, mroch]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9139 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|
|
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9127 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|