diff options
author | Matthew Draper <matthew@trebex.net> | 2014-05-01 16:30:24 +0930 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2014-05-01 16:30:24 +0930 |
commit | bf44fcc6c4af0807cdcb7d3e5567b0ec1f40cad5 (patch) | |
tree | 2f6d9665d2069186e8d994a55ac5d286d33316db /activerecord/lib/active_record | |
parent | 876155705b56e66a8b9ed96f7b79d1c8d1763200 (diff) | |
parent | c3439457e3926685bdc5e893637449cb3cf992cd (diff) | |
download | rails-bf44fcc6c4af0807cdcb7d3e5567b0ec1f40cad5.tar.gz rails-bf44fcc6c4af0807cdcb7d3e5567b0ec1f40cad5.tar.bz2 rails-bf44fcc6c4af0807cdcb7d3e5567b0ec1f40cad5.zip |
Merge pull request #14916 from moktin/real_privacy_for_functions_in_predicate_builder
Give real privacy to class methods in AR::PredicateBuilder
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/relation/predicate_builder.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb index 1252af7635..d40f276968 100644 --- a/activerecord/lib/active_record/relation/predicate_builder.rb +++ b/activerecord/lib/active_record/relation/predicate_builder.rb @@ -113,13 +113,14 @@ module ActiveRecord register_handler(Relation, RelationHandler.new) register_handler(Array, ArrayHandler.new) - private - def self.build(attribute, value) - handler_for(value).call(attribute, value) - end + def self.build(attribute, value) + handler_for(value).call(attribute, value) + end + private_class_method :build - def self.handler_for(object) - @handlers.detect { |klass, _| klass === object }.last - end + def self.handler_for(object) + @handlers.detect { |klass, _| klass === object }.last + end + private_class_method :handler_for end end |