Commit a8b89acec18abc6fecc5513ae62bbeccfd27edec
1 parent
8ab42ad6
Exists in
master
and in
28 other branches
Updating action when article is updated
Showing
2 changed files
with
4 additions
and
3 deletions
Show diff stats
app/models/article.rb
| ... | ... | @@ -2,7 +2,7 @@ require 'hpricot' |
| 2 | 2 | |
| 3 | 3 | class Article < ActiveRecord::Base |
| 4 | 4 | |
| 5 | - track_actions :create_article, :after_create, :keep_params => [:name, :url, :lead, :id], :if => Proc.new { |a| a.is_trackable? && !a.image? }, :custom_target => :action_tracker_target | |
| 5 | + track_actions :create_article, :after_create, :keep_params => [:name, :url, :lead], :if => Proc.new { |a| a.is_trackable? && !a.image? } | |
| 6 | 6 | |
| 7 | 7 | # xss_terminate plugin can't sanitize array fields |
| 8 | 8 | before_save :sanitize_tag_list |
| ... | ... | @@ -135,7 +135,8 @@ class Article < ActiveRecord::Base |
| 135 | 135 | |
| 136 | 136 | after_update :update_creation_activity |
| 137 | 137 | def update_creation_activity |
| 138 | - #update article's activity | |
| 138 | + action = ActionTracker::Record.find(:first, :conditions => {:target_type => 'Article', :target_id => self.id}) | |
| 139 | + action.touch | |
| 139 | 140 | end |
| 140 | 141 | |
| 141 | 142 | # retrieves all articles belonging to the given +profile+ that are not | ... | ... |
app/views/profile/_comment.rhtml