Created
July 14, 2011 00:58
-
-
Save oliyoung/1081662 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if at_place | |
@reward = place.rewards.cellar_door.active.first | |
else | |
@reward = place.rewards.regular.active.first | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would suggest that either Place or Reward needs a method to pick the right reward based on whatever conditions it likes.
Assuming there is in some sort of user class that defines in_place
This wraps up the ugly and you can call it like:
All depends on your context though. :)