diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-07-02 11:12:17 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-07-02 11:22:22 -0700 |
commit | 8b9f16fcb350006a8e903bd52be04f30ae8b8d89 (patch) | |
tree | afe7e248bfddfc88525879706e0d2f7503049bcd /activerecord/lib/active_record/relation/query_methods.rb | |
parent | ede2f0c71214fa9564df3cbb1f3e60796f1b39bd (diff) | |
download | rails-8b9f16fcb350006a8e903bd52be04f30ae8b8d89.tar.gz rails-8b9f16fcb350006a8e903bd52be04f30ae8b8d89.tar.bz2 rails-8b9f16fcb350006a8e903bd52be04f30ae8b8d89.zip |
resolve aliases before passing the hash to the predicate builder
Diffstat (limited to 'activerecord/lib/active_record/relation/query_methods.rb')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 05e92bea33..1327cc3c34 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -891,6 +891,7 @@ module ActiveRecord when String, Array [@klass.send(:sanitize_sql, other.empty? ? opts : ([opts] + other))] when Hash + opts = PredicateBuilder.resolve_column_aliases klass, opts attributes = @klass.send(:expand_hash_conditions_for_aggregates, opts) attributes.values.grep(ActiveRecord::Relation) do |rel| |