Skip to content

Commit

Permalink
Be backward compatible with to_fs
Browse files Browse the repository at this point in the history
  • Loading branch information
atomaka committed Dec 7, 2024
1 parent f434ac1 commit ebcc500
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spec/sql/snapshot_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@

describe "logidze_snapshot" do
let(:now) { Time.zone.local(1989, 7, 10, 18, 23, 33) }
let(:now_to_s) do
now.respond_to?(:to_fs) ? now.to_fs(:db) : now.to_s(:db)
end

let(:data) { %('{"title": "Feel me", "rating": 42, "name": "Jack", "extra": {"gender": "X"}, "updated_at": "#{now.to_fs(:db)}"}'::jsonb) }
let(:data) { %('{"title": "Feel me", "rating": 42, "name": "Jack", "extra": {"gender": "X"}, "updated_at": "#{now_to_s}"}'::jsonb) }

specify "without optional args" do
res = sql "select logidze_snapshot(#{data})"
Expand Down

0 comments on commit ebcc500

Please sign in to comment.