mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #17898 from mrgilman/move-predicate-builder-to-constructor
Move PredicateBuilder instantiation to constructor
This commit is contained in:
commit
b612df9a25
1 changed files with 5 additions and 4 deletions
|
@ -26,6 +26,7 @@ module ActiveRecord
|
|||
@values = values
|
||||
@offsets = {}
|
||||
@loaded = false
|
||||
@predicate_builder = PredicateBuilder.new(klass, table)
|
||||
end
|
||||
|
||||
def initialize_copy(other)
|
||||
|
@ -632,6 +633,10 @@ module ActiveRecord
|
|||
"#<#{self.class.name} [#{entries.join(', ')}]>"
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
attr_reader :predicate_builder
|
||||
|
||||
private
|
||||
|
||||
def exec_queries
|
||||
|
@ -677,9 +682,5 @@ module ActiveRecord
|
|||
# ignore raw_sql_ that is used by Oracle adapter as alias for limit/offset subqueries
|
||||
string.scan(/([a-zA-Z_][.\w]+).?\./).flatten.map(&:downcase).uniq - ['raw_sql_']
|
||||
end
|
||||
|
||||
def predicate_builder
|
||||
@predicate_builder ||= PredicateBuilder.new(klass, table)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue