M
Michael Furmaniuk
I installed the Windows mysql gem, I'm using MySQL on Windows, and have
been able to get the connection to work but am having trouble figuring
out what is happening with my query. What I have is (with non-essential
parts stripped out):
require 'active_record'
# Database connection
begin
dbconfig = YAML::load(File.open('../conf/database.yml'))
ActiveRecord::Base.establish_connection(dbconfig)
rescue
puts $!
end
class TestResults < ActiveRecord::Base
end
io.puts "What Agents do you want to see?\n"
io.print "Agent Name = "
my_agent = io.gets.chomp
io.puts "Looking for #{my_agent}\n"
begin
agents = TestResults.first()
io.puts %{Found #{agents.testname} - #{agents.status}}
rescue
puts $!
end
When I run interactively I can enter my Agent name but all I see then
is:
Mysql::Error: Table 'auto_harness_development.test_results' doesn't
exist: SELECT * FROM `test_results` LIMIT 1
I don't understand why test_results is getting appended to the table
name, or why its being inserted into the select statement as the table
name, is there a configuration parameter I need to set or am I just
misusing the query?
been able to get the connection to work but am having trouble figuring
out what is happening with my query. What I have is (with non-essential
parts stripped out):
require 'active_record'
# Database connection
begin
dbconfig = YAML::load(File.open('../conf/database.yml'))
ActiveRecord::Base.establish_connection(dbconfig)
rescue
puts $!
end
class TestResults < ActiveRecord::Base
end
io.puts "What Agents do you want to see?\n"
io.print "Agent Name = "
my_agent = io.gets.chomp
io.puts "Looking for #{my_agent}\n"
begin
agents = TestResults.first()
io.puts %{Found #{agents.testname} - #{agents.status}}
rescue
puts $!
end
When I run interactively I can enter my Agent name but all I see then
is:
Mysql::Error: Table 'auto_harness_development.test_results' doesn't
exist: SELECT * FROM `test_results` LIMIT 1
I don't understand why test_results is getting appended to the table
name, or why its being inserted into the select statement as the table
name, is there a configuration parameter I need to set or am I just
misusing the query?