annotate app/models/ssamr_user_detail.rb @ 1274:5ea1a213c7a5 redmine-2.2-integration

Removed Ajax calls taht are no longer working in Rails 3 and started migrating them; added a new javascript file - bibliography.js - to hold the new jquery js code; added the new show_bibtex_fields.js.erb file to replace the RJS code that was in the controller.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Thu, 09 May 2013 18:44:59 +0100
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