не понимаю, от почему я получаю сообщение об ошибке:Не удалось найти таблицу
could not find table libraryusers10s
В моем коде ниже я определяю две таблицы library_users10
и library_books10
, и связать их с классами.
Следующий код работает отлично:
require 'active_record'
ActiveRecord::Base.establish_connection(
:adapter => "sqlite3",
:database => "library8")
ActiveRecord::Schema.define do
create_table :library_users10 do |table|
table.column :user_id, :integer
table.column :name, :string
table.column :age, :string
table.column :books_borrowed, :integer
end
create_table :library_books10 do |table|
table.column :books_id, :integer
table.column :borrower_id, :integer
table.column :title, :string
table.column :borrowed, :string
table.column :due_back, :string
end
end
class LibraryUsers10 < ActiveRecord::Base
has_many :library_books9s
end
class LibraryBooks10 < ActiveRecord::Base
belongs_to :library_users10s
end
Но когда я пытаюсь заполнить таблицу, добавив следующий код сценария, я получаю ошибку could not find table libraryusers10s
libraryusers10 = LibraryUsers10.create(:user_id => 1, :name => 'Tom', :age => 10, :books_borrowed => 3)
libraryusers10.library_books10.create(:borrower_id => 1, :title => 'Who let the dogs out?', :borrowed => '13_November_2013', :due_back => '21_November_2013')
Кто-нибудь любые предложения относительно того, что здесь происходит неправильно?
Спасибо за любую помощь.