aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/core.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-04-22 00:28:51 +0900
committerGitHub <noreply@github.com>2019-04-22 00:28:51 +0900
commit56ffb2654391fc5e312723a1c3c6d58a21016500 (patch)
treed0f0307517b89d6c322aad1caaef003f39a0f89f /activerecord/lib/active_record/core.rb
parentfaf2677c7a6f6c8c947e04505d075da9f761b04d (diff)
parentf9326e567ca0d9fe957e70de821a0a644b0b441d (diff)
downloadrails-56ffb2654391fc5e312723a1c3c6d58a21016500.tar.gz
rails-56ffb2654391fc5e312723a1c3c6d58a21016500.tar.bz2
rails-56ffb2654391fc5e312723a1c3c6d58a21016500.zip
Merge pull request #36049 from kamipo/avoid_method_call
Avoid method call if `@transaction_state` is not finalized
Diffstat (limited to 'activerecord/lib/active_record/core.rb')
-rw-r--r--activerecord/lib/active_record/core.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb
index 04b21b4d00..3d4457f39f 100644
--- a/activerecord/lib/active_record/core.rb
+++ b/activerecord/lib/active_record/core.rb
@@ -466,7 +466,7 @@ module ActiveRecord
# Returns +true+ if the attributes hash has been frozen.
def frozen?
- sync_with_transaction_state
+ sync_with_transaction_state if @transaction_state&.finalized?
@attributes.frozen?
end