annotate app/models/ssamr_user_detail.rb @ 1082:997f6d7738f7 bug_531

In repo controller entry action, show the page for the file even if it's binary (so user still has access to history etc links). This makes it possible to use the entry action as the default when a file is clicked on
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Thu, 22 Nov 2012 18:04:17 +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