Class: CounterCacheUpdate::UpdateService
- Inherits:
-
ServicePattern::Service
- Object
- ServicePattern::Service
- CounterCacheUpdate::UpdateService
- Defined in:
- app/services/counter_cache_update/update_service.rb
Instance Attribute Summary collapse
-
#use_progress_bar ⇒ Object
readonly
Returns the value of attribute use_progress_bar.
Instance Method Summary collapse
- #execute! ⇒ Object
-
#initialize(use_progress_bar: false) ⇒ UpdateService
constructor
A new instance of UpdateService.
Constructor Details
#initialize(use_progress_bar: false) ⇒ UpdateService
Returns a new instance of UpdateService.
4 5 6 |
# File 'app/services/counter_cache_update/update_service.rb', line 4 def initialize(use_progress_bar: false) @use_progress_bar = end |
Instance Attribute Details
#use_progress_bar ⇒ Object (readonly)
Returns the value of attribute use_progress_bar.
2 3 4 |
# File 'app/services/counter_cache_update/update_service.rb', line 2 def @use_progress_bar end |
Instance Method Details
#execute! ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/services/counter_cache_update/update_service.rb', line 8 def execute! Rails.application.eager_load! if require "progress_bar" @progress_bar = ProgressBar.new(model_classes.size) end update_relationships! ServicePattern::Response.new(success: true) end |