Commit 7499fae95c4d0d477f161e5e0755969999ddc43c
Committed by
Antonio Terceiro
1 parent
4983bc74
Exists in
master
and in
28 other branches
Group profile activities by created_at instead of updated_at
(ActionItem1752)
Showing
4 changed files
with
4 additions
and
4 deletions
Show diff stats
test/unit/article_test.rb
@@ -926,7 +926,7 @@ class ArticleTest < Test::Unit::TestCase | @@ -926,7 +926,7 @@ class ArticleTest < Test::Unit::TestCase | ||
926 | assert_equal 'Tracked Article', ta.get_name.last | 926 | assert_equal 'Tracked Article', ta.get_name.last |
927 | assert_equal article.url, ta.get_url.last | 927 | assert_equal article.url, ta.get_url.last |
928 | assert_kind_of Person, ta.user | 928 | assert_kind_of Person, ta.user |
929 | - ta.back_in_time(26.hours) | 929 | + ta.created_at = Time.now.ago(26.hours); ta.save! |
930 | article = TinyMceArticle.create! :name => 'Another Tracked Article', :profile_id => profile.id | 930 | article = TinyMceArticle.create! :name => 'Another Tracked Article', :profile_id => profile.id |
931 | ta = ActionTracker::Record.last | 931 | ta = ActionTracker::Record.last |
932 | assert_equal ['Another Tracked Article'], ta.get_name | 932 | assert_equal ['Another Tracked Article'], ta.get_name |
vendor/plugins/action_tracker/lib/action_tracker_model.rb
@@ -37,7 +37,7 @@ module ActionTracker | @@ -37,7 +37,7 @@ module ActionTracker | ||
37 | return if u.nil? | 37 | return if u.nil? |
38 | target_hash = params[:target].nil? ? {} : {:target_type => params[:target].class.base_class.to_s, :target_id => params[:target].id} | 38 | target_hash = params[:target].nil? ? {} : {:target_type => params[:target].class.base_class.to_s, :target_id => params[:target].id} |
39 | l = last :conditions => { :user_id => u.id, :user_type => u.class.base_class.to_s, :verb => params[:verb].to_s }.merge(target_hash) | 39 | l = last :conditions => { :user_id => u.id, :user_type => u.class.base_class.to_s, :verb => params[:verb].to_s }.merge(target_hash) |
40 | - if !l.nil? and Time.now - l.updated_at < ActionTrackerConfig.timeout | 40 | + if !l.nil? and Time.now - l.created_at < ActionTrackerConfig.timeout |
41 | params[:params].clone.each { |key, value| params[:params][key] = l.params[key].clone.push(value) } | 41 | params[:params].clone.each { |key, value| params[:params][key] = l.params[key].clone.push(value) } |
42 | l.update_attributes params | 42 | l.update_attributes params |
43 | else | 43 | else |
vendor/plugins/action_tracker/test/action_tracker_model_test.rb
@@ -175,7 +175,7 @@ class ActionTrackerModelTest < ActiveSupport::TestCase | @@ -175,7 +175,7 @@ class ActionTrackerModelTest < ActiveSupport::TestCase | ||
175 | end | 175 | end |
176 | assert_kind_of ActionTracker::Record, ta | 176 | assert_kind_of ActionTracker::Record, ta |
177 | assert_equal ["bar"], ta.reload.params[:foo] | 177 | assert_equal ["bar"], ta.reload.params[:foo] |
178 | - ta.updated_at = Time.now.ago(6.minutes) | 178 | + ta.created_at = Time.now.ago(6.minutes) |
179 | ta.send :update_without_callbacks | 179 | ta.send :update_without_callbacks |
180 | t = ta.reload.updated_at | 180 | t = ta.reload.updated_at |
181 | assert_difference "ActionTracker::Record.count" do | 181 | assert_difference "ActionTracker::Record.count" do |
vendor/plugins/action_tracker/test/action_tracker_test.rb
@@ -295,7 +295,7 @@ class ActionTrackerTest < ActiveSupport::TestCase | @@ -295,7 +295,7 @@ class ActionTrackerTest < ActiveSupport::TestCase | ||
295 | get :test, :foo => "bar" | 295 | get :test, :foo => "bar" |
296 | end | 296 | end |
297 | t = ActionTracker::Record.last | 297 | t = ActionTracker::Record.last |
298 | - t.updated_at = t.updated_at.ago(6.minutes) | 298 | + t.created_at = t.updated_at.ago(6.minutes) |
299 | t.send :update_without_callbacks | 299 | t.send :update_without_callbacks |
300 | assert_difference 'ActionTracker::Record.count' do | 300 | assert_difference 'ActionTracker::Record.count' do |
301 | get :test, :foo => "test" | 301 | get :test, :foo => "test" |