diff --git a/lib/gamification_plugin/badge.rb b/lib/gamification_plugin/badge.rb index 52b3790..4b0ddf9 100644 --- a/lib/gamification_plugin/badge.rb +++ b/lib/gamification_plugin/badge.rb @@ -18,6 +18,6 @@ class GamificationPlugin::Badge < ActiveRecord::Base Merit::BadgesSash.where(:badge_id => self.id).destroy_all end - scope :notification_pending, :include => :badges_sash, :conditions => {:badges_sashes => {:notified_user => false}} + scope :notification_pending, -> { includes(:badges_sash).where(:badges_sashes => {:notified_user => false}) } end diff --git a/test/unit/api_test.rb b/test/unit/api_test.rb index 35421da..ea2ed89 100644 --- a/test/unit/api_test.rb +++ b/test/unit/api_test.rb @@ -1,5 +1,5 @@ require_relative '../test_helper' -require_relative '../../../../test/unit/api/test_helper' +require_relative '../../../../test/api/test_helper' class APITest < ActiveSupport::TestCase diff --git a/test/unit/comment_test.rb b/test/unit/comment_test.rb index 8f0e5cb..0734a98 100644 --- a/test/unit/comment_test.rb +++ b/test/unit/comment_test.rb @@ -298,7 +298,7 @@ class CommentTest < ActiveSupport::TestCase GamificationPlugin::Badge.create!(:owner => organization, :name => 'comment_author') GamificationPlugin.gamification_set_rules(environment) article.profile = organization - + article.save! 5.times { create(Comment, :source => article, :author_id => person.id) } assert_equal 'comment_author', person.badges.first.name end -- libgit2 0.21.2