Created
October 27, 2014 20:40
-
-
Save sammarcus/4c0157b6795abc84f91f 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
class Kid < ActiveRecord::Base | |
has_one :bucket | |
has_many :candies, through: :bucket | |
def pig_out(num) | |
if num <4 | |
self.feeling = "Happy" | |
else | |
self.feeling = "Sick" | |
end | |
self.bucket.candies[1, num].each do |c| | |
c.destroy | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment