У меня такое чувство, что где-то не хватает маленькой буквы "s", но через 48 часов я просто не могу найти свою ошибку:
У меня есть 2 модели: пользователи и файлы cookie.Пользователь может иметь много файлов cookie.Cookie принадлежит Cookie.
Когда я пытаюсь сделать простой current_user.cookies, у меня появляется эта ошибка:
uninitialized constant User::Cooky
Я дважды и трижды проверял, не было ли у меня множественной ошибки, но я просто не могу найтичто-то не так.
вот моя миграция таблицы куки
class CreateCookies < ActiveRecord::Migration[5.1]
def change
create_table :cookies do |t|
t.string :value
t.string :value2
t.references :user, foreign_key: true
t.references :network, foreign_key: true
t.timestamps
end
end
end
cookie.rb
class Cookie < ApplicationRecord
belongs_to :network
belongs_to :user
end
user.rb
class User < ApplicationRecord
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :validatable
has_many :room_users
has_many :rooms, through: :room_users
has_many :cookies, dependent: :destroy
end
Спасибо взаранее за вашу помощь.