annotate app/models/ssamr_user_detail.rb @ 922:ad295b270cd4 live

FIx #446: "non-utf8 paths in repositories blow up repo viewer and reposman" by ensuring the iconv conversion always happens even if source and dest are intended to be the same encoding
author Chris Cannam
date Tue, 13 Mar 2012 16:33:49 +0000
parents 8a26a0e291cf
children
rev   line source
luisf@56 1 class SsamrUserDetail < ActiveRecord::Base
luisf@60 2 belongs_to :user
luisf@64 3
luisf@64 4 validates_presence_of :description
luisf@163 5
luisf@163 6 validate :check_institution
luisf@163 7
luisf@163 8 def check_institution()
luisf@163 9 errors.add(:institution_id, "Please insert an institution") if
luisf@163 10 institution_id.blank? and other_institution.blank?
luisf@163 11 end
luisf@163 12
luis@525 13 def institution_name()
luis@525 14 if not self.institution_type.nil?
luis@525 15 if self.institution_type
luis@525 16 Institution.find(self.institution_id).name
luis@525 17 else
luis@525 18 self.other_institution
luis@525 19 end
luis@525 20 else
luis@525 21 ""
luis@525 22 end
luis@525 23 end
luisf@56 24 end