Hacker News new | past | comments | ask | show | jobs | submit login

Rails has two ways to do this. You can do any select query returning active record objects with

    Model.find_by_sql("raw select query")
And any query with a driver dependent result using

    ActiveRecord::Base.connection.execute("raw sql")
You can shorten the second one to simply "execute" by creating a method to wrap the functionality.



Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: