t27duck / active_reporting

OLAP-like DSL for ActiveRecord-based reporting
MIT License
136 stars 19 forks source link

Missing quotation marks for column cause sql errors on mysql #30

Closed germanotm closed 4 years ago

germanotm commented 4 years ago

When use Report#run, i was geting error in SQL syntax on mysql database. I managed to fix the erro by just adding quoted marks on select_statment column. For some reason you added the quoted marks only on table.

I belive this error was generated becouse my table name wasn't meaningful enough, because i already use the gem with mysql without any problem.

Anyway, i decided to put the quoted marks on select_statement as it is the default Rails way for all ActiveRecord querys.

I have changed the ActiveReporting::ReportingDimension#select_statement and the related tests.

t27duck commented 4 years ago

Awesome. Thank you very much. To be honest, after about 10 years of Rails work, I never thought to use that helper as I've never really had issues with column names.