aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation.rb
diff options
context:
space:
mode:
authorNeeraj Singh <neerajdotname@gmail.com>2013-03-03 11:55:20 -0500
committerNeeraj Singh <neerajdotname@gmail.com>2013-03-03 11:55:20 -0500
commit11731385d4a712d654e1452011f8b10d004d9c6d (patch)
tree3c1a555700062a43c1833f1b37b6171b2ff0861f /activerecord/lib/active_record/relation.rb
parent5c1354901ec36f3f9359c86d0348741a219baa47 (diff)
downloadrails-11731385d4a712d654e1452011f8b10d004d9c6d.tar.gz
rails-11731385d4a712d654e1452011f8b10d004d9c6d.tar.bz2
rails-11731385d4a712d654e1452011f8b10d004d9c6d.zip
fix the sql that is generated from scoping
Diffstat (limited to 'activerecord/lib/active_record/relation.rb')
-rw-r--r--activerecord/lib/active_record/relation.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb
index bc50802c4a..efbae108b9 100644
--- a/activerecord/lib/active_record/relation.rb
+++ b/activerecord/lib/active_record/relation.rb
@@ -236,8 +236,9 @@ module ActiveRecord
# Scope all queries to the current scope.
#
# Comment.where(post_id: 1).scoping do
- # Comment.first # SELECT * FROM comments WHERE post_id = 1
+ # Comment.first
# end
+ # # => SELECT "comments".* FROM "comments" WHERE "comments"."post_id" = 1 ORDER BY "comments"."id" ASC LIMIT 1
#
# Please check unscoped if you want to remove all previous scopes (including
# the default_scope) during the execution of a block.