Merge pull request #2551 from esparta/using_polimorfic_for_not_signed_abilities

Improve overall performance on not_signed abilities
This commit is contained in:
Henne Vogelsang 2019-07-17 16:20:02 +02:00 committed by GitHub
commit c5ad9525ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,7 +36,7 @@ class Ability
end
# can view Commercials of confirmed Events
can :show, Commercial, commercialable_type: 'Event', commercialable_id: Event.where(state: 'confirmed').pluck(:id)
can :show, Commercial, commercialable: Event.where(state: 'confirmed')
can [:show, :create], User
can [:index, :show], Survey, surveyable_type: 'Conference'