pic_vert_app/app/models/person.rb
2013-01-08 23:28:47 +01:00

16 lines
458 B
Ruby

# -*- encoding : utf-8 -*-
class Person < ActiveRecord::Base
belongs_to :sheet
#validates_presence_of :surname, :firstname
has_many :people_newsgroups
has_many :newsgroups, :through => :people_newsgroups
attr_accessible :newsgroup_ids, :newsletter, :surname, :firstname, :email, :phone, :job
validates :surname, :presence => true
validates :firstname, :presence => true
def name
self.firstname.to_s+" "+self.surname.to_s
end
end