Module: AnnouncementsHelper
- Defined in:
- app/helpers/announcements_helper.rb
Instance Method Summary collapse
- #announcement_unread?(announcement) ⇒ Boolean
- #announcement_visibility_allowed? ⇒ Boolean
- #announcement_visible?(announcement) ⇒ Boolean
- #current_announcement ⇒ Object
Instance Method Details
#announcement_unread?(announcement) ⇒ Boolean
6 7 8 |
# File 'app/helpers/announcements_helper.rb', line 6 def announcement_unread?(announcement) [announcement.] != "hidden" end |
#announcement_visibility_allowed? ⇒ Boolean
14 15 16 |
# File 'app/helpers/announcements_helper.rb', line 14 def announcement_visibility_allowed? !! current_user end |
#announcement_visible?(announcement) ⇒ Boolean
2 3 4 |
# File 'app/helpers/announcements_helper.rb', line 2 def announcement_visible?(announcement) announcement.exists? && announcement_unread?(announcement) end |
#current_announcement ⇒ Object
10 11 12 |
# File 'app/helpers/announcements_helper.rb', line 10 def current_announcement @current_announcement ||= Announcement.current end |