On Nov 25, 12:32 am, Ryan Kohler <[EMAIL PROTECTED]> wrote:
> Two models, a game, and a player.  The game should start as soon as
> there are enough players in the game
> #####################################################
>
> class Game < ActiveRecord::Base
>   has_many :players
>
>   should_start
>     return players.count >= number_of_players #number_of_players is
> defined in the database
>   end
>
>   def start
>     started = true  #started is a variable defined in the database
>     save
not the problem here but just as a FYI your start method is a no-op.
you're setting a local variable, not the database attribute.

Fred

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to