app/models/tramway/event/event.rb in tramway-event-1.9.2 vs app/models/tramway/event/event.rb in tramway-event-1.9.3
- old
+ new
@@ -20,17 +20,7 @@
return :will_begin_soon if request_collecting_begin_date > DateTime.now
return :is_over if request_collecting_end_date < DateTime.now
return :are_being_right_now if request_collecting_begin_date&.past? && request_collecting_end_date&.future?
end
- ::Tramway::Partner::Partnership.partnership_type.values.each do |partnership_type|
- define_method partnership_type.pluralize.to_sym do
- query = <<-SQL
- tramway_partner_partnerships.partnership_type = '#{partnership_type}'
- AND tramway_partner_partnerships.partner_id = '#{id}'
- AND tramway_partner_partnerships.state = 'active'
- AND tramway_partner_partnerships.partner_type = 'Tramway::Event::Event'
- SQL
- Tramway::Partner::Organization.joins(:partnerships).where(query)
- end
- end
+ include ::Tramway::Partner::Scopes
end