Deferring job attributes from the table differently in different environments

I am using a held job for queue a Model

in another Model

like this:

article_loader.rb

date_value_in_string =  "2017-06-21 07:17:00"
Article.delay(:queue => 'article_load').article_loading([date_value_in_string])

      

Even though I passed a String as an argument to the method, inside the method it is converted to a Time object in the runtime.

article.rb in a production environment

def self.article_loading(args)
  date_value = args[0]
  p date_value.class # Time
end

      

In a development environment, this is a string.

article.rb in development environment

def self.article_loading(args)
  date_value = args[0]
  p date_value.class # String
end

      

I don't know why this is happening. Any help would be appreciated.

+1


source to share





All Articles