Ruby on rails NoMethodError(类:模块的未定义方法`scoped';):

Ruby on rails NoMethodError(类:模块的未定义方法`scoped';):,ruby-on-rails,has-many-through,Ruby On Rails,Has Many Through,我有很多很多很多:通过这种关系 class Guestlist < ActiveRecord::Base belongs_to :venues has_many :patrons has_many :users, :through => :patrons attr_accessible :capacity, :end_time, :name, :start_time, :venue_id end class Patron < ActiveR

我有很多很多很多:通过这种关系

class Guestlist < ActiveRecord::Base
    belongs_to :venues

    has_many :patrons
    has_many :users, :through => :patrons

    attr_accessible :capacity, :end_time, :name, :start_time, :venue_id
end

class Patron < ActiveRecord::Base
    belongs_to :guestlists
    belongs_to :users
    attr_accessible :guestlist_id, :user_id, :checked_in
end

class User < ActiveRecord::Base
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable

  attr_accessible :name, :email, :password, :password_confirmation, :remember_me

  has_many :patrons
  has_many :guestlists, :through => :patrons
end
将抛出以下错误

NoMethodError (undefined method `scoped' for Users:Module)

我一直在寻找一个解决方案,但没有任何效果。请帮忙

型号
用户中的关联出现问题。奇异化
用户
访客列表
。参考更多

class用户
谢谢!仍在学习rails。有很多关系不应该是单数的,对吧?你不会碰巧知道我在哪里可以研究如何更新没有主键的用户表吧?@Adgezaza。。rails中的每个关联都有一个单数或复数形式。它只是指示关联是否是一对一、一对多等等。通读关联将使你很好地理解什么是基本关联。当您将数据插入用户或访客列表时,用户表(也称为联接表)将自动更新。但用户表作为我要更新的“签入”字段。如果我尝试对用户记录进行更新,则会出现以下错误。。。“where子句中的未知列‘用户’:更新
用户
设置
已签入
=1,其中
用户
``为空”
NoMethodError (undefined method `scoped' for Users:Module)
class Patron < ActiveRecord::Base
    belongs_to :guestlist 
    belongs_to :user
    attr_accessible :guestlist_id, :user_id, :checked_in
end