Module: ActiveWorker::Expandable
- Defined in:
- lib/active_worker/expandable.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/active_worker/expandable.rb', line 4 def self.included(base) base.template_field :number_of_threads, type: Integer, default: 1 base.template_field :number_of_workers, type: Integer, default: 1 base.belongs_to :thread_root_configuration, :polymorphic => true base.has_many :thread_expanded_configurations, :as => :thread_root_configuration, :class_name => 'ActiveWorker::Configuration', :autosave => true end |
Instance Method Details
#configurations_for_events ⇒ Object
28 29 30 |
# File 'lib/active_worker/expandable.rb', line 28 def configurations_for_events [self] + end |
#expand_for_threads ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/active_worker/expandable.rb', line 14 def maps = expansion_maps_for_threads maps[1..-1].each do |map_hash| map_hash[:thread_root_configuration_id] = id map_hash[:thread_root_configuration_type] = _type end (maps) end |
#expand_for_workers ⇒ Object
23 24 25 26 |
# File 'lib/active_worker/expandable.rb', line 23 def maps = expansion_maps_for_workers (maps) end |