Class: SiteAnnouncement
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- SiteAnnouncement
- Defined in:
- app/models/site_announcement.rb
Defined Under Namespace
Classes: BodyHelper
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.feed_announcements(options = {}) ⇒ Object
20 21 22 23 |
# File 'app/models/site_announcement.rb', line 20 def self.feed_announcements ={} [:limit] ||= 5 self.where(["show_in_feed = ?",true]).order("created_at DESC").limit([:limit]) end |
.headline_announcement ⇒ Object
16 17 18 |
# File 'app/models/site_announcement.rb', line 16 def self.headline_announcement self.headline_announcements.first end |
Instance Method Details
#body_html ⇒ Object
25 26 27 |
# File 'app/models/site_announcement.rb', line 25 def body_html helper.simple_format(helper.auto_link(body,:sanitize=>true),{},:sanitize=>true).html_safe end |