From: Josh Cheek Date: 2011-09-12T13:06:18+09:00 Subject: Re: why doesn't this code work? --bcaec50160fb0496af04acb6a608 Content-Type: text/plain; charset=ISO-8859-1 On Sun, Sep 11, 2011 at 9:09 PM, Derek Seymour wrote: > Can't find the table which I know exists in the database connection > given... > > > > > require 'csv' > require 'rubygems' > require 'sqlite3' > require 'active_record' > > > # connect to database. This will create one if it doesn't exist > MY_DB_NAME = "development.sqlite3" > MY_DB = SQLite3::Database.new(MY_DB_NAME) > > # get active record set up > ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database > => MY_DB_NAME) > > > #this prints out false, even though I know it exists!!!!! > > puts ActiveRecord::Base.connection.table_exists?("Users") > > > > > # get access to a user record (in theory) > class User < ActiveRecord::Base > > end > > > > #spits the dummy on this line cos it doesn't know what the table is > > puts User.count > > -- > Posted via http://www.ruby-forum.com/. > > First thought is that you should give the full path to the database. --bcaec50160fb0496af04acb6a608--