diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-04-14 17:51:27 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2019-04-14 20:55:46 +0900 |
commit | 533dd8a681a3ea7d12acdfc6a2d6a95891282b49 (patch) | |
tree | b22773b8adf3d7b4ebcb93d25c38f38d676193cb /activerecord/lib/active_record/touch_later.rb | |
parent | 3e66ba91d511158e22f90ff96b594d61f40eda01 (diff) | |
download | rails-533dd8a681a3ea7d12acdfc6a2d6a95891282b49.tar.gz rails-533dd8a681a3ea7d12acdfc6a2d6a95891282b49.tar.bz2 rails-533dd8a681a3ea7d12acdfc6a2d6a95891282b49.zip |
Don't expose `add_to_transaction`
`add_to_transaction` was added at da840d1, but it should not be called
by except internal, since `remember_transaction_record_state` should be
called only once before saving.
And also, currently `add_to_transaction` doesn't always add the record
to transaction since da8de91, that is the reason hard to use that even
in internal.
Even if `add_to_transaction` ensure to add the record to transaction,
that is an internal concern, people don't need to explicitly call
`add_to_transaction`.
Diffstat (limited to 'activerecord/lib/active_record/touch_later.rb')
-rw-r--r-- | activerecord/lib/active_record/touch_later.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/touch_later.rb b/activerecord/lib/active_record/touch_later.rb index 5dc88fb26c..980e42664b 100644 --- a/activerecord/lib/active_record/touch_later.rb +++ b/activerecord/lib/active_record/touch_later.rb @@ -22,7 +22,7 @@ module ActiveRecord @_touch_time = current_time_from_proper_timezone surreptitiously_touch @_defer_touch_attrs - self.class.connection.add_transaction_record self + add_to_transaction # touch the parents as we are not calling the after_save callbacks self.class.reflect_on_all_associations(:belongs_to).each do |r| |