23 lines
579 B
Ruby
23 lines
579 B
Ruby
|
module FoodsoftActiveJobArguments
|
||
|
def self.included(base) # :nodoc:
|
||
|
base.class_eval do
|
||
|
alias_method :orig_deserialize, :deserialize
|
||
|
alias_method :orig_serialize, :serialize
|
||
|
|
||
|
def serialize(arguments)
|
||
|
ret = orig_serialize(arguments)
|
||
|
ret.unshift FoodsoftConfig.scope
|
||
|
end
|
||
|
|
||
|
def deserialize(arguments)
|
||
|
FoodsoftConfig.select_multifoodcoop arguments.shift
|
||
|
orig_deserialize(arguments)
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
ActiveSupport.on_load(:after_initialize) do
|
||
|
ActiveJob::Arguments.include FoodsoftActiveJobArguments
|
||
|
end
|