Related questions
Rails raw SQL example
How can I convert this code to raw sql and use in rails? Because When I deploy this code in heroku,there is a request timeout error.I think this will be faster if I use raw sql.
@payments = PaymentDetail.…
Rails 4 LIKE query - ActiveRecord adds quotes
I am trying to do a like query like so
def self.search(search, page = 1 )
paginate :per_page => 5, :page => page,
:conditions => ["name LIKE '%?%' OR postal_code like '%?%'", search, search], order => 'name'
end
…
Rails 3 execute custom sql query without a model
I need to write a standalone ruby script that is supposed to deal with database. I used code given below in rails 3
@connection = ActiveRecord::Base.establish_connection(
:adapter => "mysql2",
:host => "localhost",
:database => "siteconfig_development",
:username => "root",
:…