You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working with postgres jsonb columns, the build in rails where tools fail
Expected behavior
Given that I have a postgres jsonb column like this:
create_table "widgets", id: :serial, force: :cascade do |t|
t.jsonb "jsonb_column_name", default: [], null: false
...
end
rubocop should ignore the following code Widget.where("jsonb_column_name = ?", "[]")
Actual behavior
rubocop corrects the code to: Widget.where(jsonb_column_name: "[]")
which returns 0 records as it is now looking for the string literal rather than an empty array
When working with postgres jsonb columns, the build in rails where tools fail
Expected behavior
Given that I have a postgres jsonb column like this:
rubocop should ignore the following code
Widget.where("jsonb_column_name = ?", "[]")
Actual behavior
rubocop corrects the code to:
Widget.where(jsonb_column_name: "[]")
which returns 0 records as it is now looking for the string literal rather than an empty array
Steps to reproduce the problem
see above
RuboCop version
The text was updated successfully, but these errors were encountered: