From 9ab45399b9369aa94a22bc75d00aa099b9ddc49c Mon Sep 17 00:00:00 2001 From: Andrew Haines Date: Sun, 17 Feb 2013 10:38:47 +0000 Subject: [PATCH] Define `before_remove_const` callback Closes #465 --- lib/draper/automatic_delegation.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/draper/automatic_delegation.rb b/lib/draper/automatic_delegation.rb index 828c597..06762a8 100644 --- a/lib/draper/automatic_delegation.rb +++ b/lib/draper/automatic_delegation.rb @@ -39,6 +39,12 @@ module Draper def delegatable?(method) source_class? && source_class.respond_to?(method) end + + # @private + # Avoids reloading the model class when ActiveSupport clears autoloaded + # dependencies in development mode. + def before_remove_const + end end included do