Add (admin-only) tickets via 'visibile' attribute [migration]

(cherry picked from commit ce0db3d7a736e7bcde480721986dbfb4a82aa083)
This commit is contained in:
James Mason 2018-04-09 11:53:31 -07:00 committed by Henne Vogelsang
parent 6e276b2787
commit 199bc00c08
No known key found for this signature in database
GPG key ID: 97DDB66BDAF8D4D6
15 changed files with 73 additions and 9 deletions

View file

@ -3,7 +3,8 @@
class TicketsController < ApplicationController
before_action :authenticate_user!
load_resource :conference, find_by: :short_title
load_resource :ticket, through: :conference
before_action :load_tickets
authorize_resource :ticket, through: :conference
authorize_resource :conference_registrations, class: Registration
before_action :check_load_resource, only: :index
@ -14,4 +15,8 @@ class TicketsController < ApplicationController
redirect_to root_path, notice: "There are no tickets available for #{@conference.title}!"
end
end
def load_tickets
@tickets = @conference.tickets.visible
end
end