Compare commits
5 Commits
Author | SHA1 | Date |
---|---|---|
spen | 6b2eb0e90c | |
spen | bbda5bcfac | |
spen | 67640e0fc4 | |
spen | 89a472ffb6 | |
spen | b14218e312 |
|
@ -16,7 +16,7 @@ class Bulletin
|
|||
# include Tire::Model::Search
|
||||
# include Tire::Model::Callbacks
|
||||
|
||||
is_impressionable
|
||||
is_impressionable :counter_cache => { :column_name => :view_count }
|
||||
|
||||
field :title, localize: true
|
||||
field :subtitle, localize: true
|
||||
|
@ -28,6 +28,7 @@ class Bulletin
|
|||
field :view_count, :type => Integer, :default => 0
|
||||
|
||||
field :public, :type => Boolean, :default => true
|
||||
field :rss_link
|
||||
|
||||
field :email_sent, :type => Boolean, :default => false
|
||||
field :email_sentdate , :type => DateTime
|
||||
|
@ -158,10 +159,6 @@ class Bulletin
|
|||
User.find(self.email_user_ids) rescue []
|
||||
end
|
||||
|
||||
def view_count
|
||||
Impression.where(:impressionable_id=>self.id).count
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
# def clean_values
|
||||
|
|
|
@ -32,6 +32,11 @@
|
|||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% unless @bulletin.rss_link.blank? %>
|
||||
<div>
|
||||
<%= link_to t('ntu.rss_origin'), @bulletin.rss_link %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= share_links(@bulletin, 'announcement') %>
|
Loading…
Reference in New Issue