aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/lib/active_record/relation.rb12
m---------arel10
2 files changed, 11 insertions, 11 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb
index b69a12bc7b..570ba3f80d 100644
--- a/activerecord/lib/active_record/relation.rb
+++ b/activerecord/lib/active_record/relation.rb
@@ -21,27 +21,27 @@ module ActiveRecord
end
def select(selects)
- Relation.new(@klass, @relation.project(selects))
+ selects.blank? ? self : Relation.new(@klass, @relation.project(selects))
end
def group(groups)
- Relation.new(@klass, @relation.group(groups))
+ groups.blank? ? self : Relation.new(@klass, @relation.group(groups))
end
def order(orders)
- Relation.new(@klass, @relation.order(orders))
+ orders.blank? ? self : Relation.new(@klass, @relation.order(orders))
end
def limit(limits)
- Relation.new(@klass, @relation.take(limits))
+ limits.blank? ? self : Relation.new(@klass, @relation.take(limits))
end
def offset(offsets)
- Relation.new(@klass, @relation.skip(offsets))
+ offsets.blank? ? self : Relation.new(@klass, @relation.skip(offsets))
end
def on(join)
- Relation.new(@klass, @relation.on(join))
+ join.blank? ? self : Relation.new(@klass, @relation.on(join))
end
def joins(join, join_type = nil)
diff --git a/arel b/arel
-Subproject 3d747a56b76ae97645dd265cc75e73e5f782719
+Subproject 755a7ced2f98b0bb246089c80cdfa04cd918fa8