aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/relation.rb16
1 files changed, 6 insertions, 10 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb
index 1d6fced952..4ed118b02d 100644
--- a/activerecord/lib/active_record/relation.rb
+++ b/activerecord/lib/active_record/relation.rb
@@ -50,14 +50,14 @@ module ActiveRecord
@records = if find_with_associations
begin
options = {
- :select => @select_values.any? ? @select_values.join(", ") : nil,
+ :select => @select_values.join(", "),
:joins => arel.joins(arel),
- :group => @group_values.any? ? @group_values.join(", ") : nil,
- :order => order_clause,
+ :group => @group_values.join(", "),
+ :order => @order_values.join(', '),
:conditions => where_clause,
- :limit => arel.taken,
- :offset => arel.skipped,
- :from => (arel.send(:from_clauses) if arel.send(:sources).present?)
+ :limit => @limit_value,
+ :offset => @offset_value,
+ :from => @from_value
}
including = (@eager_load_values + @includes_values).uniq
@@ -185,10 +185,6 @@ module ActiveRecord
arel.send(:where_clauses).join(join_string)
end
- def order_clause
- @order_clause ||= arel.send(:order_clauses).join(', ')
- end
-
def references_eager_loaded_tables?
joined_tables = (tables_in_string(arel.joins(arel)) + [table.name, table.table_alias]).compact.uniq
(tables_in_string(to_sql) - joined_tables).any?