Invoking a large set of SQL from a Rails 4 application

前端 未结 8 1034
有刺的猬
有刺的猬 2020-12-30 07:11

I have a Rails 4 application that I use in conjunction with sidekiq to run asynchronous jobs. One of the jobs I normally run outside of my Rails application is

8条回答
  •  旧巷少年郎
    2020-12-30 07:36

    If you want to execute raw SQL through active record you can use this API: ActiveRecord::Base.connection.execute("SELECT COUNT(*) FROM users")

提交回复
热议问题