-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix AnnouncementsController crashes when not logged in
`@unread_announcements` becomes `false` when not logged in. Then it will be crashed on rendering view. This error was found via `Ruby::IncompatibleAssignment` error from Steep :-) Note: The UnreachableBranch is not emmited by default. Locally, I enabled the "strict" settings of Steep to find this bug.
- Loading branch information
Showing
3 changed files
with
13 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
sig/handwritten/app/controllers/announcements_controller.rbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class AnnouncementsController < ApplicationController | ||
@event: Event | ||
|
||
@announcements: Announcement::ActiveRecord_Relation | ||
|
||
@unread_announcements: UnreadAnnouncement::ActiveRecord_Associations_CollectionProxy? | ||
|
||
@announcement: Announcement | ||
|
||
@unread_announcement: UnreadAnnouncement? | ||
end |
10 changes: 0 additions & 10 deletions
10
sig/prototype/app/controllers/announcements_controller.rbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters