# HG changeset patch # User luisf # Date 1311601998 -3600 # Node ID 8a26a0e291cff86560266c84ceab8d938474bba6 # Parent 0b6c82dead2888a7202f142dca1eac79853ae9c6 Added method to retrieve a user's institution name to the ssamr_user_detail Model. diff -r 0b6c82dead28 -r 8a26a0e291cf app/models/ssamr_user_detail.rb --- a/app/models/ssamr_user_detail.rb Mon Jul 25 14:23:37 2011 +0100 +++ b/app/models/ssamr_user_detail.rb Mon Jul 25 14:53:18 2011 +0100 @@ -10,5 +10,15 @@ institution_id.blank? and other_institution.blank? end - + def institution_name() + if not self.institution_type.nil? + if self.institution_type + Institution.find(self.institution_id).name + else + self.other_institution + end + else + "" + end + end end