Skip to content

Commit

Permalink
fix remove_constant to stop removing constants accidentally
Browse files Browse the repository at this point in the history
  • Loading branch information
genkami committed Nov 7, 2018
1 parent cb4b603 commit 8542c62
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions padrino-core/lib/padrino-core/reloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def remove_constant(const)
return if constant_excluded?(const)
base, _, object = const.to_s.rpartition('::')
base = base.empty? ? Object : base.constantize
return unless base.const_get(object).equal?(const)
base.send :remove_const, object
logger.devel "Removed constant #{const} from #{base}"
rescue NameError
Expand Down

0 comments on commit 8542c62

Please sign in to comment.