kvokka / pp_sql

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

When I turn off `rewrite_to_sql_method` this also prevents `pp_sql` from working #22

Closed benlieb closed 3 years ago

benlieb commented 3 years ago

PpSql.rewrite_to_sql_method=false

Makes pp_sql not format the sql. Is this intentional? It seems not...

kvokka commented 3 years ago

Yes, it is.

With this flag you have the method on #pp_sql, which produce the formatted output, while #to_sql method from ActiveRecord is not touched.

benlieb commented 3 years ago

I think you've misread my comment. This setting PpSql.rewrite_to_sql_method=false is ALSO causing pp_sql to not format AT ALL.

So, it IS touched.

kvokka commented 3 years ago

There is a spec for this case https://github.com/kvokka/pp_sql/blob/690dbfe9b98b6ee89b53db49ad2b94ed09fce362/test/pp_sql_test.rb#L31

If you mean something else, then, please, give me please an example or make a spec for it.

Thank you