Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Chris Underwood
Full Stack JavaScript Techdegree Student 19,916 PointsFinding Scopes Code Challenge 2
I am on the struggle bus with this code challenge. Below is my code which, based on the examples I have seen in the videos and the Rails documentation I believe is right but I cannot get it to pass.
person.rb
1 class Person < ActiveRecord::Base 2 scope :hamptons, -> {where("first_name LIKE ?", "Hampton")} 3 end
I am not looking for someone to give me the answer, but a nudge in the right direction would be appreciated.
Thanks,
Chris
2 Answers

Chris Underwood
Full Stack JavaScript Techdegree Student 19,916 PointsGot the answer finally. scope :hamptons, -> { where(first_name: "Hampton")}

Carlos Reyes
30,056 PointsI tried: LIKE, IS, =
Then I went trough the video transcripts, Ctrl+F, "name"... trying to find an example!