diff --git a/app/models/approve_comment.rb b/app/models/approve_comment.rb index c45e761..6e7e77f 100644 --- a/app/models/approve_comment.rb +++ b/app/models/approve_comment.rb @@ -1,13 +1,12 @@ class ApproveComment < Task validates_presence_of :target_id - settings_items :comment_attributes, :closing_statment + settings_items :comment_attributes, :closing_statment - validates_presence_of :comment_attributes + validates_presence_of :comment_attributes def comment - @comment ||= Comment.new(JSON.parse(self.comment_attributes)) unless self.comment_attributes.nil? - @comment + @comment ||= Comment.new(JSON.parse(self.comment_attributes)) unless self.comment_attributes.nil? end def requestor_name @@ -22,7 +21,6 @@ class ApproveComment < Task article ? article.name : _("Article removed.") end - def perform comment.save! end @@ -33,8 +31,8 @@ class ApproveComment < Task def icon result = {:type => :defined_image, :src => '/images/icons-app/article-minor.png'} - result.merge({:url => article.url}) if article - return result + result.merge!({:url => article.url}) if article + result end def linked_subject diff --git a/test/unit/approve_comment_test.rb b/test/unit/approve_comment_test.rb index 48f9dab..29d8353 100644 --- a/test/unit/approve_comment_test.rb +++ b/test/unit/approve_comment_test.rb @@ -144,8 +144,6 @@ class ApproveCommentTest < ActiveSupport::TestCase end should 'default decision be skip if there is an article associated to task' do -# a = ApproveComment.create!(:name => 'test name', :target => @community, :comment_attributes => @comment.attributes.to_json, :requestor => @profile) -#FIXME see if article= method will survive a = ApproveComment.new(:comment_attributes => @comment.attributes.to_json) assert 'skip', a.default_decision end -- libgit2 0.21.2