From 4d7809ec1402c47550afa5e5d80c2505baba9a28 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Thu, 20 Mar 2014 02:35:59 +0400 Subject: [PATCH] #345: rollback changes, added test_after_commit gem --- Gemfile | 1 + Gemfile.lock | 2 ++ app/models/concerns/feed/comment.rb | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index bd1615fa2..d8aace642 100644 --- a/Gemfile +++ b/Gemfile @@ -123,4 +123,5 @@ group :test do gem 'shoulda-matchers' gem 'mock_redis', '~> 0.11' gem 'rake' + gem 'test_after_commit' end diff --git a/Gemfile.lock b/Gemfile.lock index 3d2d4071f..80bf4e1f1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -415,6 +415,7 @@ GEM sqlite3 (>= 1.3.3) state_machine (1.2.0) stringex (2.1.2) + test_after_commit (0.2.3) therubyracer (0.12.1) libv8 (~> 3.16.14.0) ref @@ -538,6 +539,7 @@ DEPENDENCIES skype soundmanager-rails state_machine (~> 1.2) + test_after_commit therubyracer (~> 0.12.1) therubyrhino (~> 1.73.1) time_diff diff --git a/app/models/concerns/feed/comment.rb b/app/models/concerns/feed/comment.rb index 1f60ade43..1927cbdc6 100644 --- a/app/models/concerns/feed/comment.rb +++ b/app/models/concerns/feed/comment.rb @@ -2,7 +2,7 @@ module Feed::Comment extend ActiveSupport::Concern included do - after_create :new_comment_notifications + after_commit :new_comment_notifications, on: :create # dont remove outdated issues link after_update -> { Comment.create_link_on_issues_from_item(self) } end