Skip to content

Commit

Permalink
Merge pull request #51 from gocardless/rails-6
Browse files Browse the repository at this point in the history
Be more resilient against unexpected time values.
  • Loading branch information
Nick Campbell authored Sep 30, 2019
2 parents 21a9fa3 + 9b14710 commit 65b0c56
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/que/adapters/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,13 @@ def execute_prepared(name, params)
# json
114 => ->(value) { JSON_MODULE.load(value, create_additions: false) },
# timestamp with time zone
1184 => Time.method(:parse),
1184 => ->(value) {
case value
when Time then value
when String then Time.parse(value)
else raise "Unexpected time class: #{value.class} (#{value.inspect})"
end
},
}.freeze

def cast_result(result)
Expand Down

0 comments on commit 65b0c56

Please sign in to comment.