Skip to content

Instantly share code, notes, and snippets.

@rishabg
rishabg / about.md
Created August 14, 2011 04:29 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@rishabg
rishabg / ar_loop.rb
Last active November 25, 2015 14:12
AR Loop test
# 1. Briefly explain what the following code does.
# 2. Is there anything wrong with it?
# 3. How would you resolve the problems (if any exist)?
# Assume League, Team, Player models
# League <has_many> teams
# Team <has_many> players
# Player has boolean column all_star
def all_stars(league_name)
league = League.find_by_name league_name