aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorHector Satre <moktin@gmail.com>2014-05-01 08:16:33 +0200
committerHector Satre <moktin@gmail.com>2014-05-01 08:16:33 +0200
commitc3439457e3926685bdc5e893637449cb3cf992cd (patch)
tree2f6d9665d2069186e8d994a55ac5d286d33316db /activerecord
parent876155705b56e66a8b9ed96f7b79d1c8d1763200 (diff)
downloadrails-c3439457e3926685bdc5e893637449cb3cf992cd.tar.gz
rails-c3439457e3926685bdc5e893637449cb3cf992cd.tar.bz2
rails-c3439457e3926685bdc5e893637449cb3cf992cd.zip
Give real privacy to class methods in AR::PredicateBuilder
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/CHANGELOG.md4
-rw-r--r--activerecord/lib/active_record/relation/predicate_builder.rb15
2 files changed, 12 insertions, 7 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index 17b71199aa..7568773aad 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,3 +1,7 @@
+* Give ActiveRecord::PredicateBuilder private methods the privacy they deserve
+
+ *Hector Satre*
+
* When using a custom `join_table` name on a `habtm`, rails was not saving it
on Reflections. This causes a problem when rails loads fixtures, because it
uses the reflections to set database with fixtures.
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