Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix the sql that is generated from scoping

  • Loading branch information...
commit 11731385d4a712d654e1452011f8b10d004d9c6d 1 parent 5c13549
Neeraj Singh neerajdotname authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  activerecord/lib/active_record/relation.rb
3  activerecord/lib/active_record/relation.rb
View
@@ -236,8 +236,9 @@ def many?
# 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.
Please sign in to comment.
Something went wrong with that request. Please try again.