-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rails/active job: Time casting fails #247
Comments
My assumption is that The following patch fixes this. @@ -152,7 +152,11 @@ module Que
},
# Timestamp with time zone
- 1184 => Time.method(:parse),
+ 1184 => -> (value) {
+ return value if value.is_a?(Time)
+
+ Time.parse(value)
+ },
}
# JSON, JSONB
|
Fixed in master. |
Is it possible to also fix this on 0.x branch? We use this in production and 1.0 wasnt stable enough, but it looks like it was only fixed on 1.0 beta |
For those using one of the later versions of the Que::Adapters::Base::CAST_PROCS[1184] = lambda do |value|
case value
when Time then value
when String then Time.parse(value)
else raise "Unexpected time class: #{value.class} (#{value.inspect})"
end
end This will patch the issue when upgrading to Rails 6. |
Anything about 1.0 is ready? |
@newbenji Check the 1.0 milestone: https://github.com/que-rb/que/milestone/1 |
Using rails
6.0.0.rc1
and pg1.1.4
:rails new foo && cd foo
active_job.queue_adapter = :que
generate migration, migrate database)rails g job example
rails runner ExampleJob
Resulting in:
The text was updated successfully, but these errors were encountered: