diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-03-03 17:47:57 -0800 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-03-03 17:47:57 -0800 |
commit | d3fa0259696ff20b77f9a2dfd206c9ab8627a669 (patch) | |
tree | 4978cefbc47e86cf7be62d0f573cd30251259b34 /activerecord | |
parent | 9ee6f3cc8ef1cd50648ec2882803943d3bd1f24a (diff) | |
parent | 11731385d4a712d654e1452011f8b10d004d9c6d (diff) | |
download | rails-d3fa0259696ff20b77f9a2dfd206c9ab8627a669.tar.gz rails-d3fa0259696ff20b77f9a2dfd206c9ab8627a669.tar.bz2 rails-d3fa0259696ff20b77f9a2dfd206c9ab8627a669.zip |
Merge pull request #9532 from neerajdotname/fix-sql-in-example
In example fix sql that is generated from scoping
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/relation.rb | 3 |
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. |