Skip to content

Commit 415a933

Browse files
allow updating video url of published events
1 parent 78aba89 commit 415a933

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

  • packages/admin_dashboard_portal/app/policies/admin_dashboard_portal/hackathon
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
class AdminDashboardPortal::Hackathon::EventPolicy < ::Hackathon::EventPolicy
2-
def update?
3-
record.draft?
4-
end
5-
62
def publish_event?
73
# Only allow publishing draft events
84
record.draft?
95
end
6+
7+
def permitted_attributes_for_update
8+
if record.published?
9+
[:video_url]
10+
else
11+
super
12+
end
13+
end
1014
end

0 commit comments

Comments
 (0)