I have a problem that when I pass some Date
objects as arguments to different methods, they turn into String
.
In my Rails app, there is a service that calls a Sidekiq worker to execute a method in a model.
When the service object is initialized, it has Date
instance methods. I have confirmed their types using debugger.
It passes the instance methods to a Sidekiq worker using perform_async
. The perform
method is Sidekiq is a one line method that invokes a method in a model, passing arguments it received from the service to the model.
In the model side, the argument passed in from the Sidekiq worker is no longer a Date
type. They are String
(e.g. "2015-01-20"). I have confirmed this using degugger.
Any thoughts on why this is happening?