osem-fcy/app/helpers/conference_helper.rb
James Mason fa55224163 Break up the one-query-of-doom
The single query was producing a tremendously large ActiveRecord allocation.

While this isn't nearly as cool as one query, it's still a significant
reduction in SQL trips, and now has the bonus of only loading what is
actually going to be displayed.
2017-12-22 10:48:55 -08:00

17 lines
405 B
Ruby

module ConferenceHelper
# Return true if only call_for_papers or call_for_tracks is open
def one_call_open(*calls)
calls.one? { |call| call.try(:open?) }
end
# URL for sponsorship emails
def sponsorship_mailto(conference)
[
'mailto:',
conference.contact.sponsor_email,
'?subject=',
url_encode(conference.short_title),
'%20Sponsorship'
].join
end
end