kvokka / pp_sql

Rails ActiveRecord SQL queries log beautifier
MIT License
265 stars 9 forks source link

JSON query broken due to extra space #15

Open djpate opened 4 years ago

djpate commented 4 years ago

We've encountered a weird bug here when using a JSONB column.

if you have a where clause like

.where("event_metadata.metadata -> 'replaced' != 'true'")

The query will be replaced by

event_metadata.metadata - > 'replaced' != 'true'

notice the extra space between the - and >

This prevents the query from being run.