Class: StructureObserver
- Inherits:
-
ActiveRecord::Observer
- Object
- ActiveRecord::Observer
- StructureObserver
- Defined in:
- app/observers/structure_observer.rb
Class Method Summary collapse
-
.update_routes ⇒ Object
Clear all avaiable cache.
Instance Method Summary collapse
Class Method Details
.update_routes ⇒ Object
Clear all avaiable cache
19 20 21 22 |
# File 'app/observers/structure_observer.rb', line 19 def self.update_routes Rails.application.reload_routes! Rails.cache.clear end |
Instance Method Details
#after_create(_record) ⇒ Object
6 7 8 |
# File 'app/observers/structure_observer.rb', line 6 def after_create(_record) self.class.update_routes end |
#after_destroy(_record) ⇒ Object
14 15 16 |
# File 'app/observers/structure_observer.rb', line 14 def after_destroy(_record) self.class.update_routes end |
#after_update(_record) ⇒ Object
10 11 12 |
# File 'app/observers/structure_observer.rb', line 10 def after_update(_record) self.class.update_routes end |