Skip to content

Commit

Permalink
Fix AS::Dep.remove_const with non-existent const.
Browse files Browse the repository at this point in the history
  • Loading branch information
thedarkone committed Apr 5, 2014
1 parent ea27d9e commit 207ca40
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/rails_development_boost/dependencies_patch.rb
Expand Up @@ -494,7 +494,9 @@ def remove_explicit_dependency(const_name, depending_const)

def clear_tracks_of_removed_const(const_name, object = nil)
autoloaded_constants.delete(const_name)
@module_cache.remove_const(const_name, object)
# @module_cache might be nil if remove_constant has been called with a non-existent constant, ie: it hasn't been checked with `qualified_const_defined?`. Because AS::Dep doesn't blow, neither
# should we.
@module_cache.remove_const(const_name, object) if @module_cache
LoadedFile.const_unloaded(const_name)
end

Expand Down

0 comments on commit 207ca40

Please sign in to comment.