use query in ruby on rails code example Example: Ruby on rails execute query ActiveRecord::Base.connection.execute("SQL query")