Skip to content

Commit

Permalink
Initialize @has_query_constraints to false in the inherited hook
Browse files Browse the repository at this point in the history
`has_query_constraints?` is a class method so doing it in init_internals
would not define the right variable.
  • Loading branch information
rafaelfranca committed Aug 21, 2023
1 parent bef4c69 commit 77080d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/persistence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,7 @@ def inherited(subclass)
super
subclass.class_eval do
@_query_constraints_list = nil
@has_query_constraints = false
end
end

Expand Down Expand Up @@ -1140,7 +1141,6 @@ def init_internals
super
@_trigger_destroy_callback = @_trigger_update_callback = nil
@previously_new_record = false
@has_query_constraints = false
end

def strict_loaded_associations
Expand Down

0 comments on commit 77080d5

Please sign in to comment.