Rails 3 execute custom sql query without a model January 1, 2023 by Tarik Maybe try this: ActiveRecord::Base.establish_connection(...) ActiveRecord::Base.connection.execute(...)