Last change
on this file since aac6b0a was
7b7d827,
checked in by njw <njw@…>, 11 years ago
|
opened projects: hothotwrite and contact
|
-
Property mode set to
100644
|
File size:
428 bytes
|
Line | |
---|
1 | class 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 |
---|
15 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.