Module: RailsDevelopmentBoost::DescendantsTrackerPatch
- Defined in:
- lib/rails_development_boost/descendants_tracker_patch.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.apply! ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/rails_development_boost/descendants_tracker_patch.rb', line 5 def self.apply! # removing the .clear method across all Rails/Ruby versions begin ActiveSupport::DescendantsTracker.send(:remove_method, :clear) rescue NameError end begin ActiveSupport::DescendantsTracker.singleton_class.send(:remove_method, :clear) rescue NameError end ActiveSupport::DescendantsTracker.extend self end |
Instance Method Details
#clear ⇒ Object
25 26 |
# File 'lib/rails_development_boost/descendants_tracker_patch.rb', line 25 def clear end |
#delete(klass) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/rails_development_boost/descendants_tracker_patch.rb', line 18 def delete(klass) class_variable_get(:@@direct_descendants).tap do |direct_descendants| direct_descendants.delete(klass) direct_descendants.each_value {|descendants| descendants.delete(klass)} end end |