Add conference specifc route to revision history page
This commit is contained in:
parent
5965bcf193
commit
51d569794f
5 changed files with 16 additions and 11 deletions
|
|
@ -1,15 +1,14 @@
|
|||
module Admin
|
||||
class VersionsController < Admin::BaseController
|
||||
load_resource :conference, find_by: :short_title
|
||||
load_and_authorize_resource class: PaperTrail::Version
|
||||
|
||||
def index
|
||||
authorize! :index, PaperTrail::Version.new(item_type: 'User')
|
||||
@conf_ids_for_organizer = current_user.is_admin? ? Conference.pluck(:id) : Conference.with_role(:organizer, current_user).pluck(:id)
|
||||
@conference_id = params[:conference_id].to_i unless params[:conference_id].nil?
|
||||
@conf_ids_for_organizer = current_user.is_admin? ? Conference.pluck(:short_title) : Conference.with_role(:organizer, current_user).pluck(:short_title)
|
||||
|
||||
return unless @conference_id.present?
|
||||
authorize! :index, PaperTrail::Version.new(conference_id: @conference_id)
|
||||
@versions = @versions.where(conference_id: @conference_id)
|
||||
return unless @conference.present?
|
||||
authorize! :index, PaperTrail::Version.new(conference_id: @conference.id)
|
||||
@versions = @versions.where(conference_id: @conference.id)
|
||||
end
|
||||
|
||||
def revert_attribute
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue