pic_vert_app/app/models/person.rb
2013-01-08 22:47:42 +01:00

15 lines
431 B
Ruby

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