1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Do not allow mutation for empty clauses

This commit is contained in:
Ryuta Kamizono 2019-12-17 16:19:21 +09:00
parent f854b46aba
commit bc02120392
2 changed files with 2 additions and 2 deletions

View file

@ -19,7 +19,7 @@ module ActiveRecord
end end
def self.empty def self.empty
@empty ||= new(nil, nil) @empty ||= new(nil, nil).freeze
end end
end end
end end

View file

@ -83,7 +83,7 @@ module ActiveRecord
end end
def self.empty def self.empty
@empty ||= new([]) @empty ||= new([]).tap(&:referenced_columns).freeze
end end
def contradiction? def contradiction?