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