class Personal < ActiveRecord::Base # Associations belongs_to :user before_save :set_age ## TODO: fix this def set_age self.age = Time.zone.now - self.birthdate return self.age end end |
class Personal < ActiveRecord::Base # Associations belongs_to :user before_save :set_age ## TODO: fix this def set_age self.age = Time.zone.now - self.birthdate return self.age end end |