nil error?

The attributes that Rails creates by reading the content_columns from a db table are not instance variables as in a traditional Ruby class. They are actually all stored in an internal hash called attributes, and Rails does some method_missing magic to create accessors for you. By creating the accessor for odds as you have, you've effectively aliased the db column.

Instead, you can initialize your player object like this:

Player.new(:odds=>...)

and your win_game method:

def win_game   self.odds += 1 (or update_attributes(:odds, self.odds+1) if you want to persist it immediately) end

HTH, AndyV