diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-11-04 20:48:02 -0200 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-05 11:27:34 -0700 |
commit | 3146aa68fd03ea4392b45f1c8771675a9c850471 (patch) | |
tree | 6f229814d49e9c9da4bb4a276a5a291b093c50d8 /activerecord/lib/active_record/relation | |
parent | d5e45931a0f3d36515d6048fd9cb13f641018571 (diff) | |
download | rails-3146aa68fd03ea4392b45f1c8771675a9c850471.tar.gz rails-3146aa68fd03ea4392b45f1c8771675a9c850471.tar.bz2 rails-3146aa68fd03ea4392b45f1c8771675a9c850471.zip |
Fixes queries using limits and punctuation in order, removes order("col1, col2") usage in favor of order(["col1", "col2"})
[#4597 state:committed]
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r-- | activerecord/lib/active_record/relation/finder_methods.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index fe1ef2e2e3..ab9f10b380 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -222,7 +222,7 @@ module ActiveRecord end def construct_limited_ids_condition(relation) - orders = relation.order_values.join(", ") + orders = relation.order_values values = @klass.connection.distinct("#{@klass.connection.quote_table_name @klass.table_name}.#{@klass.primary_key}", orders) ids_array = relation.select(values).collect {|row| row[@klass.primary_key]} |