From e0f366627db9dde817dd768b0168d8ee7ba44d3a Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Thu, 27 Feb 2014 16:01:03 -0300 Subject: [PATCH] rails3: fix conflict with two activated plugins that has extensions. --- config/initializers/active_record_extensions.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+), 0 deletions(-) diff --git a/config/initializers/active_record_extensions.rb b/config/initializers/active_record_extensions.rb index e530435..9004fb9 100644 --- a/config/initializers/active_record_extensions.rb +++ b/config/initializers/active_record_extensions.rb @@ -1 +1,17 @@ require 'upload_sanitizer' + +module ActiveRecordExtension + + extend ActiveSupport::Concern + + module ClassMethods + def reflect_on_association(name) + reflection = super + if reflection.nil? && self.superclass.respond_to?(:reflect_on_association) + reflection = self.superclass.reflect_on_association(name) + end + reflection + end + end +end +ActiveRecord::Base.send(:include, ActiveRecordExtension) -- libgit2 0.21.2