diff --git a/plugins/comment_paragraph/lib/ext/article.rb b/plugins/comment_paragraph/lib/ext/article.rb index 36d0fa3..ab19aac 100644 --- a/plugins/comment_paragraph/lib/ext/article.rb +++ b/plugins/comment_paragraph/lib/ext/article.rb @@ -6,8 +6,6 @@ class Article before_save :comment_paragraph_plugin_parse_html - before_create :comment_paragraph_plugin_set_initial_value - settings_items :comment_paragraph_plugin_activate, :type => :boolean, :default => false def comment_paragraph_plugin_enabled? @@ -21,6 +19,7 @@ class Article protected def comment_paragraph_plugin_parse_html + comment_paragraph_plugin_set_initial_value unless persisted? return unless comment_paragraph_plugin_activated? if body && (body_changed? || setting_changed?(:comment_paragraph_plugin_activate)) @@ -45,7 +44,6 @@ class Article def comment_paragraph_plugin_set_initial_value self.comment_paragraph_plugin_activate = comment_paragraph_plugin_enabled? && comment_paragraph_plugin_settings.activation_mode == 'auto' - true end def comment_paragraph_plugin_settings diff --git a/plugins/comment_paragraph/test/functional/comment_paragraph_plugin_admin_controller_test.rb b/plugins/comment_paragraph/test/functional/comment_paragraph_plugin_admin_controller_test.rb index c94d97d..8012e28 100644 --- a/plugins/comment_paragraph/test/functional/comment_paragraph_plugin_admin_controller_test.rb +++ b/plugins/comment_paragraph/test/functional/comment_paragraph_plugin_admin_controller_test.rb @@ -1,5 +1,5 @@ -require File.dirname(__FILE__) + '/../../../../test/test_helper' -require File.dirname(__FILE__) + '/../../controllers/comment_paragraph_plugin_admin_controller' +require_relative '../../../../test/test_helper' +require_relative '../../controllers/comment_paragraph_plugin_admin_controller' # Re-raise errors caught by the controller. class CommentParagraphPluginAdminController; def rescue_action(e) raise e end; end diff --git a/plugins/comment_paragraph/test/functional/comment_paragraph_plugin_profile_controller_test.rb b/plugins/comment_paragraph/test/functional/comment_paragraph_plugin_profile_controller_test.rb index 5942273..edaf8aa 100644 --- a/plugins/comment_paragraph/test/functional/comment_paragraph_plugin_profile_controller_test.rb +++ b/plugins/comment_paragraph/test/functional/comment_paragraph_plugin_profile_controller_test.rb @@ -1,5 +1,5 @@ -require File.dirname(__FILE__) + '/../test_helper' -require File.dirname(__FILE__) + '/../../controllers/profile/comment_paragraph_plugin_profile_controller' +require_relative '../test_helper' +require_relative '../../controllers/profile/comment_paragraph_plugin_profile_controller' # Re-raise errors caught by the controller. class CommentParagraphPluginProfileController; def rescue_action(e) raise e end; end diff --git a/plugins/comment_paragraph/test/functional/comment_paragraph_plugin_public_controller_test.rb b/plugins/comment_paragraph/test/functional/comment_paragraph_plugin_public_controller_test.rb index 9884939..db91afa 100644 --- a/plugins/comment_paragraph/test/functional/comment_paragraph_plugin_public_controller_test.rb +++ b/plugins/comment_paragraph/test/functional/comment_paragraph_plugin_public_controller_test.rb @@ -1,5 +1,5 @@ -require File.dirname(__FILE__) + '/../test_helper' -require File.dirname(__FILE__) + '/../../controllers/public/comment_paragraph_plugin_public_controller' +require_relative '../test_helper' +require_relative '../../controllers/public/comment_paragraph_plugin_public_controller' # Re-raise errors caught by the controller. diff --git a/plugins/comment_paragraph/test/functional/content_viewer_controller_test.rb b/plugins/comment_paragraph/test/functional/content_viewer_controller_test.rb index e003716..01c6363 100644 --- a/plugins/comment_paragraph/test/functional/content_viewer_controller_test.rb +++ b/plugins/comment_paragraph/test/functional/content_viewer_controller_test.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../test_helper' +require_relative '../test_helper' class ContentViewerController append_view_path File.join(File.dirname(__FILE__) + '/../../views') diff --git a/plugins/comment_paragraph/test/test_helper.rb b/plugins/comment_paragraph/test/test_helper.rb index cca1fd3..70322cf 100644 --- a/plugins/comment_paragraph/test/test_helper.rb +++ b/plugins/comment_paragraph/test/test_helper.rb @@ -1 +1 @@ -require File.dirname(__FILE__) + '/../../../test/test_helper' +require_relative '../../../test/test_helper' diff --git a/plugins/comment_paragraph/test/unit/allow_comment_test.rb b/plugins/comment_paragraph/test/unit/allow_comment_test.rb index ebbe109..503d763 100644 --- a/plugins/comment_paragraph/test/unit/allow_comment_test.rb +++ b/plugins/comment_paragraph/test/unit/allow_comment_test.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../test_helper' +require_relative '../test_helper' class AllowCommentTest < ActiveSupport::TestCase diff --git a/plugins/comment_paragraph/test/unit/article_test.rb b/plugins/comment_paragraph/test/unit/article_test.rb index 40074cb..52d480f 100644 --- a/plugins/comment_paragraph/test/unit/article_test.rb +++ b/plugins/comment_paragraph/test/unit/article_test.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../test_helper' +require_relative '../test_helper' require 'benchmark' class ArticleTest < ActiveSupport::TestCase diff --git a/plugins/comment_paragraph/test/unit/comment_paragraph_plugin_test.rb b/plugins/comment_paragraph/test/unit/comment_paragraph_plugin_test.rb index 9506aaf..ad98d64 100644 --- a/plugins/comment_paragraph/test/unit/comment_paragraph_plugin_test.rb +++ b/plugins/comment_paragraph/test/unit/comment_paragraph_plugin_test.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../test_helper' +require_relative '../test_helper' include ActionView::Helpers::FormTagHelper class CommentParagraphPluginTest < ActiveSupport::TestCase diff --git a/plugins/comment_paragraph/test/unit/comment_test.rb b/plugins/comment_paragraph/test/unit/comment_test.rb index 0ee3f57..e529e87 100644 --- a/plugins/comment_paragraph/test/unit/comment_test.rb +++ b/plugins/comment_paragraph/test/unit/comment_test.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../test_helper' +require_relative '../test_helper' class CommentTest < ActiveSupport::TestCase -- libgit2 0.21.2