Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix named scope + class method example

Closes #8804 [ci skip]
  • Loading branch information...
commit 8242345c43ca89e2430a0278ce863b2733ae6261 1 parent efbb041
@carlosantoniodasilva carlosantoniodasilva authored
Showing with 1 addition and 3 deletions.
  1. +1 −3 activerecord/lib/active_record/scoping/named.rb
View
4 activerecord/lib/active_record/scoping/named.rb
@@ -134,16 +134,14 @@ def scope_attributes? # :nodoc:
# end
#
# def self.titles
- # map(&:title)
+ # pluck(:title)
# end
- #
# end
#
# We are able to call the methods like this:
#
# Article.published.featured.latest_article
# Article.featured.titles
-
def scope(name, body, &block)
extension = Module.new(&block) if block
Please sign in to comment.
Something went wrong with that request. Please try again.