comparison app/helpers/activities_helper.rb @ 1502:cadec15c77d5 cannam

Merge from branch "live"
author Chris Cannam
date Fri, 21 Mar 2014 13:03:45 +0000
parents 1c7af51e9409
children afce8026aaeb
comparison
equal deleted inserted replaced
1501:467282ce64a4 1502:cadec15c77d5
136 def busy_institutions(events, count) 136 def busy_institutions(events, count)
137 authors = events.map do |e| 137 authors = events.map do |e|
138 e.event_author unless !e.respond_to?(:event_author) 138 e.event_author unless !e.respond_to?(:event_author)
139 end.compact 139 end.compact
140 institutions = authors.map do |a| 140 institutions = authors.map do |a|
141 if a.respond_to?(:ssamr_user_detail) and !a.ssamr_user_detail.nil? 141 if a.respond_to?(:ssamr_user_detail) and !a.ssamr_user_detail.nil? and a.ssamr_user_detail.institution_name != "none"
142 a.ssamr_user_detail.institution_name 142 a.ssamr_user_detail.institution_name
143 end 143 end
144 end 144 end
145 insthash = institutions.compact.sort.group_by { |i| i } 145 insthash = institutions.compact.sort.group_by { |i| i }
146 insthash = insthash.merge(insthash) { |k,v| v.length } 146 insthash = insthash.merge(insthash) { |k,v| v.length }