To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / app / models / ssamr_user_detail.rb @ 437:102056ec2de9
History | View | Annotate | Download (294 Bytes)
| 1 |
class SsamrUserDetail < ActiveRecord::Base |
|---|---|
| 2 |
belongs_to :user
|
| 3 |
|
| 4 |
validates_presence_of :description
|
| 5 |
|
| 6 |
validate :check_institution
|
| 7 |
|
| 8 |
def check_institution() |
| 9 |
errors.add(:institution_id, "Please insert an institution") if |
| 10 |
institution_id.blank? and other_institution.blank?
|
| 11 |
end
|
| 12 |
|
| 13 |
|
| 14 |
end
|