This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| # 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 |