Raw Insert Query with ActiveRecord

These past days have taken me to a place that I need to learn more about executing a raw query, without relying on generated active record object (existing model classes).

Last week, I wrote a lib, that I think, required me to wrote it with custom or raw query. My research was filled with these kind of results

ActiveRecord::Base.connection.execute(...)

I used it actually. But, until I find it hard to produce a query string that free from SQL injection. Anyone knows how to do it? Continue reading “Raw Insert Query with ActiveRecord”