diff options
Diffstat (limited to 'activerecord/lib/active_record/relation/predicate_builder.rb')
-rw-r--r-- | activerecord/lib/active_record/relation/predicate_builder.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb index 71bb795d5b..61db27d150 100644 --- a/activerecord/lib/active_record/relation/predicate_builder.rb +++ b/activerecord/lib/active_record/relation/predicate_builder.rb @@ -17,7 +17,7 @@ module ActiveRecord register_handler(Base, BaseHandler.new) register_handler(Range, RangeHandler.new) register_handler(Relation, RelationHandler.new) - register_handler(Array, ArrayHandler.new) + register_handler(Array, ArrayHandler.new(self)) end def resolve_column_aliases(hash) @@ -93,6 +93,10 @@ module ActiveRecord @handlers.unshift([klass, handler]) end + def build(attribute, value) + handler_for(value).call(attribute, value) + end + protected attr_reader :klass, :table @@ -129,10 +133,6 @@ module ActiveRecord attributes end - def build(attribute, value) - handler_for(value).call(attribute, value) - end - def handler_for(object) @handlers.detect { |klass, _| klass === object }.last end |