Hello list,
I’m new to ActiveRecord. Actually, I’m using it outside of a rails
application (crazy I know). I have the following simple test code:
=============================================
require ‘rubygems’
require ‘activerecord’
require ‘yaml’
dbconfig = YAML::load_file(‘database.yml’)
ActiveRecord::Base.establish_connection(dbconfig)
class User < ActiveRecord::Base
end
ua = User.new()
where my database.yml file looks like
adapter: ‘mysql’
host: ‘localhost’
username: ‘myusername’
password: ‘mypassword’
database: ‘mysql’
I get the following error
Table ‘mysql.users’ doesn’t exist: SHOW FIELDS FROM users
(ActiveRecord::StatementInvalid)
The database I’m connecting to maintains a User table – note that the
name of the table is singular. How can I connect to a table that has
a name like User? ActiveRecord seems to append an ‘s’ character and
tries to connect to a Users table.
Thanks for any help
Robert