I'm running ruby on Mac OSX 10.6.4, using Ruby 1.8 and activerecord 2.3.8. I'm running the following code inside of NetBeans 6.9 but I'm using the ruby interpreter from 10.6
I have the following code:
require 'rubygems'
require 'active_record'
ActiveRecord::Base.establish_connection
(
:adapter=> "mysql",
:host => "localhost",
:username => "test",
)
class Test_information < ActiveRecord::Base
set_table_name = "test_information"
end
record = Test_information.find(:first)
When the code runs I get an error that it can't find the table test_informations. There is a table called test_information and I can query it...but not with activerecord.
Is there some magic incantation that I have to use with set_table_name? I was under the impression that it was pretty straightforward to use an existing schema with activerecord...
Any ideas?
Thanks in advance,
--Robert