source: de.wigbels.ruby/contact/app/models/contact.rb@ c22952c

Last change on this file since c22952c was 7b7d827, checked in by njw <njw@…>, 11 years ago

opened projects: hothotwrite and contact

  • Property mode set to 100644
File size: 428 bytes
RevLine 
[7b7d827]1class Contact < ActiveRecord::Base
2 # 1..1
3 belongs_to :contactgroup
4
5 validates_presence_of :name, :surname
6 # If somebody has no email, the following validation does not work
7 #validates_uniqueness_of :email
8
9 def self.get_contactsfrom groupname
10 find :all,
11 :include => [:contactgroup],
12 :conditions => ["contactgroups.groupname = ?", groupname],
13 :order => "name, surname"
14 end
15end
Note: See TracBrowser for help on using the repository browser.