我有以下有效记录模型:
class Relationship < ActiveRecord::Base
belongs_to :user
belongs_to :follower, :class_name => 'User', :foreign_key => 'follower_id'
end
class User < ActiveRecord::Base
has_many :relationships
has_many :followers, :through => :relationships
end
尝试user.followers时出错
ArgumentError:未知密钥:标识符
来自/home/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.7/lib /active_support/core_ext/hash/keys.rb:43:in`assert_valid_keys'