activerecord-hackery / squeel

Active Record, improved. Live again :)
http://erniemiller.org/2013/11/17/anyone-interested-in-activerecord-hackery/
MIT License
2.4k stars 214 forks source link

MySQL concat function #417

Closed cchko closed 8 years ago

cchko commented 8 years ago

MySQL doesn't offer concat operators (||, +) but instead a concat() function.

Is it possible to call this with squeel? concat and __send__(:concat) don't appear to work.

Concat operators can be turned on in MySQL, but I'm interested in a solution that doesn't require that.

cchko commented 8 years ago

Just realized I can do this with a string.

select { "concat(users.last_name, ', ', users.first_name) as full_name" }