Skip to content

Commit

Permalink
Merge pull request #132 from featurist/master
Browse files Browse the repository at this point in the history
Don't use `nil` as payload key.
  • Loading branch information
reidmorrison committed Jun 16, 2021
2 parents aec7eaf + 014cfb8 commit f9f9f9c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rails_semantic_logger/active_record/log_subscriber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def render_bind_v6_1(attr, value)
attr = nil
end

[attr&.name, value]
[attr&.name || :nil, value]
end

def type_casted_binds_v5_0_3(binds, casted_binds)
Expand Down
2 changes: 1 addition & 1 deletion test/active_record_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class ActiveRecordTest < Minitest::Test
if Rails.version.to_f >= 6.1
# Rails 6.1 dropped the bound column name
# Can be removed once this PR is fixed: https://github.com/rails/rails/pull/41068
assert_equal [2, 3], binds[nil], -> { actual.ai }
assert_equal [2, 3], binds[:nil], -> { actual.ai }
else
assert_equal [2, 3], binds[:age], -> { actual.ai }
end
Expand Down

0 comments on commit f9f9f9c

Please sign in to comment.