Skip to content

Commit

Permalink
Cast SQLServer's :datetimeoffset to time
Browse files Browse the repository at this point in the history
  • Loading branch information
vividmuimui committed Mar 4, 2024
1 parent 4a6f9b9 commit c730d0a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/ransack/nodes/value.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def cast(type)
case type
when :date
cast_to_date(value)
when :datetime, :timestamp, :time, :timestamptz
when :datetime, :timestamp, :time, :timestamptz, :datetimeoffset
cast_to_time(value)
when :boolean
cast_to_boolean(value)
Expand Down
2 changes: 1 addition & 1 deletion spec/ransack/nodes/value_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module Nodes
context "with a timestamp value" do
let(:raw_value) { "2022-05-23 10:40:02 -0400" }

[:datetime, :timestamp, :time, :timestamptz].each do |type|
[:datetime, :timestamp, :time, :timestamptz, :datetimeoffset].each do |type|
it "should cast #{type} correctly" do
result = subject.cast(type)

Expand Down

0 comments on commit c730d0a

Please sign in to comment.