mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-17 21:54:06 +00:00
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.
17 lines
405 B
Ruby
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
|