This commit is contained in:
Stella Rouzi 2026-06-27 18:17:28 +02:00 committed by GitHub
commit e06a47820c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 118 additions and 25 deletions

View file

@ -109,6 +109,10 @@ class Ability
event.users.include?(user)
end
can :toggle_favorite, Event do |event|
event.scheduled?
end
# can manage the commercials of their own events
can :manage, Commercial, commercialable_type: 'Event', commercialable_id: user.events.pluck(:id)