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
def self.empty
@empty ||= new(nil, nil)
@empty ||= new(nil, nil).freeze
end
end
end

View File

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