diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-26 18:08:26 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-26 18:08:26 -0300 |
commit | 923e274313dda8c772922e859df681f3d050a30e (patch) | |
tree | ef31fe6a9a6e3ab9570e9eb0753f90f7e9faa29e /activerecord/lib/active_record/relation/predicate_builder.rb | |
parent | e11e285b1373b0399433943198aefbcdd29db09b (diff) | |
parent | 00b024218f1c91fde1217ae4951bd2c817bc9ea9 (diff) | |
download | rails-923e274313dda8c772922e859df681f3d050a30e.tar.gz rails-923e274313dda8c772922e859df681f3d050a30e.tar.bz2 rails-923e274313dda8c772922e859df681f3d050a30e.zip |
Merge pull request #15300 from arthurnn/refactor_reflections
Refactor reflections
Diffstat (limited to 'activerecord/lib/active_record/relation/predicate_builder.rb')
-rw-r--r-- | activerecord/lib/active_record/relation/predicate_builder.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb index d40f276968..eff5c8f09c 100644 --- a/activerecord/lib/active_record/relation/predicate_builder.rb +++ b/activerecord/lib/active_record/relation/predicate_builder.rb @@ -26,7 +26,7 @@ module ActiveRecord queries << '1=0' else table = Arel::Table.new(column, default_table.engine) - association = klass.reflect_on_association(column.to_sym) + association = klass._reflect_on_association(column.to_sym) value.each do |k, v| queries.concat expand(association && association.klass, table, k, v) @@ -55,7 +55,7 @@ module ActiveRecord # # For polymorphic relationships, find the foreign key and type: # PriceEstimate.where(estimate_of: treasure) - if klass && reflection = klass.reflect_on_association(column.to_sym) + if klass && reflection = klass._reflect_on_association(column.to_sym) if reflection.polymorphic? && base_class = polymorphic_base_class_from_value(value) queries << build(table[reflection.foreign_type], base_class) end |