From 9268dfb0b9c663d803c0c0c9542f96d888be233c Mon Sep 17 00:00:00 2001 From: Guillaume DOTT Date: Thu, 7 Aug 2014 17:40:29 +0200 Subject: [PATCH] Do not automatically include TheModerator::Model in ActiveRecord::Base When automatically including the module in ActiveRecord::Base, it gives a hierarchy error with Rails 4. The module must be included in the required models. --- lib/the_moderator.rb | 2 -- lib/the_moderator/railtie.rb | 9 --------- 2 files changed, 11 deletions(-) delete mode 100644 lib/the_moderator/railtie.rb diff --git a/lib/the_moderator.rb b/lib/the_moderator.rb index d473b90..fcb7b75 100644 --- a/lib/the_moderator.rb +++ b/lib/the_moderator.rb @@ -2,5 +2,3 @@ require 'the_moderator/version' require 'the_moderator/exceptions' require 'the_moderator/model' require 'the_moderator/moderation_model' - -require 'the_moderator/railtie' if defined?(Rails) diff --git a/lib/the_moderator/railtie.rb b/lib/the_moderator/railtie.rb deleted file mode 100644 index 01a9bbd..0000000 --- a/lib/the_moderator/railtie.rb +++ /dev/null @@ -1,9 +0,0 @@ -module TheModerator - class Railtie < Rails::Railtie - initializer "the_moderator.include_in_active_record" do - ActiveSupport.on_load :active_record do - include TheModerator::Model - end - end - end -end