diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb index 38a7ecf9ea..a8d0a48480 100644 --- a/activerecord/lib/active_record/persistence.rb +++ b/activerecord/lib/active_record/persistence.rb @@ -493,7 +493,7 @@ def query_constraints(*columns_list) end def has_query_constraints? # :nodoc: - @has_query_constraints ||= nil + @has_query_constraints end def query_constraints_list # :nodoc: @@ -1140,6 +1140,7 @@ def init_internals super @_trigger_destroy_callback = @_trigger_update_callback = nil @previously_new_record = false + @has_query_constraints = false end def strict_loaded_associations