Repository URL to install this package:
|
Version:
4.0.0.pre.3 ▾
|
module Core
# Provides helpers for handling trials.
#
# Intended to be mixed into Booking.
module TrialConcern
extend ActiveSupport::Concern
def valid_for_trial?
if event.organisation_venue.trial_available?
previous_bookings = user.bookings.joins(:event).where(
core_events: { organisation_venue_id: event.organisation_venue.id })
return true if (previous_bookings - [self]).empty?
end
false
end
end
end