1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-03 14:24:23 +01:00
fab-manager/app/controllers/rss/events_controller.rb
2019-12-02 11:57:25 +01:00

13 lines
448 B
Ruby

# frozen_string_literal: true
# RSS feed about 10 last events
class Rss::EventsController < Rss::RssController
def index
@events = Event.includes(:event_image, :event_files, :availability, :category)
.where('availabilities.start_at >= ?', DateTime.current)
.order('availabilities.start_at ASC').references(:availabilities).limit(10)
@fab_name = Setting.find_by(name: 'fablab_name').value
end
end