Module: SwitchmanInstJobs::Delayed::Backend::ActiveRecord::AbstractJob::ClassMethods
- Defined in:
- lib/switchman_inst_jobs/delayed/backend/active_record/abstract_job.rb
Instance Method Summary collapse
Instance Method Details
#current_switchman_shard ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/switchman_inst_jobs/delayed/backend/active_record/abstract_job.rb', line 9 def current_switchman_shard connected_to_stack.reverse_each do |hash| if hash[:switchman_shard] && hash[:klasses].include?(connection_class_for_self) return hash[:switchman_shard] end end ::ActiveRecord::Base.current_switchman_shard.delayed_jobs_shard end |