Skip to content

Conversation

@ralphos
Copy link

@ralphos ralphos commented Dec 10, 2012

I cheated a little since I had already done this exercise in the previous batch (though I did change it up so my answer is not exactly the same). Nonetheless, it was a good recap on the basics of ActiveRecord and I do enjoy this approach of incrementally learning about the inner-workings of Rails!

watchman.rb Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should probably name this sports, not sport since it references an array

If you do want to just find one of them, you can either:

Sport.find_by_name(input)
Sport.where(name: input).first

@jwo
Copy link
Member

jwo commented Dec 12, 2012

Looks great -- added a minor note about plural and how to fetch just 1 record.

@ralphos
Copy link
Author

ralphos commented Dec 13, 2012

Thanks! Fixed the naming of my variable too 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants