Displaying 1 result from an estimated 1 matches for "assign_age_items".
2007 Mar 22
3
assign events on creation of a new user
...tually I would like to
have it so that you can be within 5 years on either side of the median
age defined for the event and it will auto associate upon creation of
a new user.
Here is some of my code...
I was trying to get it to work with a callback in the user model
called ''before_save :assign_age_items''
class User < ActiveRecord::Base
has_many :occurrences, :dependent => :destroy #, :conditions =>
"enabled = 1"
has_many :events, :through => :occurrences
before_save :assign_age_items
validates_uniqueness_of :username, :on => :create, :message => &qu...