1
0
Fork 0
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:
Sean Griffin 2014-12-03 11:31:45 -07:00
commit b612df9a25

View file

@ -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