Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9121951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:58:43+00:00 2026-06-17T05:58:43+00:00

Why is this code according to the documentation works ? http://api.rubyonrails.org/classes/ActiveRecord/Scoping/Named/ClassMethods.html class Article <

  • 0

Why is this code according to the documentation works ?
http://api.rubyonrails.org/classes/ActiveRecord/Scoping/Named/ClassMethods.html

class Article < ActiveRecord::Base
  scope :featured, where(:featured => true)

  def self.titles
    map(&:title)
  end
end

Article.featured.titles

In my console gets:

NoMethodError: undefined method `map' for #<Class:0xb70bfb0>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T05:58:44+00:00Added an answer on June 17, 2026 at 5:58 am

    My initial answer was the right one: it can’t work…

    I guess I finally convinced myself because docs should rule…

    Well, I think what’s important in the doc is the idea: you can chain scopes with class methods.

    But the implementation of the class method given in example is definitely wrong.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to the documentation page: http://matplotlib.sourceforge.net/api/pyplot_api.html the way to use the axvline is like
According to Apple's documentation here , this should work in my code: @interface Menu
Background: According to the documentation at http://aspnetwebstack.codeplex.com/documentation (under 'Getting and Building the Code' the
According to this: http://code.activestate.com/lists/python-list/413540/ , tokenize.generate_tokens should be used and not tokenize.tokenize . This
according to this code i dont understand about NSClassFromString how did i know viewControllerName
according to this code if i want to access imageView1 and imageView2 how can
I know this issue was posted before, and i fixed my code according to
According to this feature matrix , Visual Studio 2010 Premium (RC) includes static code
This code is the core of a much larger script that works great in
this code works fine: procedure TForm2.Timer1Timer(Sender: TObject); var Text: string; begin SetLength (Text,555); GetWindowText

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.