created can_manage_comments helper for rendering button

This commit is contained in:
raluka 2015-08-26 22:09:36 +02:00
parent 84cd952b57
commit a3b6f204cb
4 changed files with 8 additions and 4 deletions

View file

@ -137,7 +137,7 @@ class Ability
can :manage, Sponsor, conference_id: conf_ids_for_organizer
can :manage, SponsorshipLevel, conference_id: conf_ids_for_organizer
can :manage, Ticket, conference_id: conf_ids_for_organizer
can [:index, :create], Comment, commentable_type: 'Event',
can :index, Comment, commentable_type: 'Event',
commentable_id: Event.where(conference_id: conf_ids_for_organizer).pluck(:id)
end
@ -157,7 +157,7 @@ class Ability
can :manage, CallForPaper, conference_id: conf_ids_for_cfp
can :manage, Commercial, commercialable_type: 'Event',
commercialable_id: Event.where(conference_id: conf_ids_for_cfp).pluck(:id)
can [:index, :create], Comment, commentable_type: 'Event',
can :index, Comment, commentable_type: 'Event',
commentable_id: Event.where(conference_id: conf_ids_for_cfp).pluck(:id)
end