执行此操作时出现此错误:
user.owned_tipsters
错误:
ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERREUR: column tipsters.user_id does not exist
我的代码:
class User < ActiveRecord::Base
has_many :owned_tipsters, class_name: 'Tipster', inverse_of: :owner
end
class Tipster < ActiveRecord::Base
belongs_to :owner, class_name: 'User', inverse_of: :owned_tipsters
end
如果你能帮助我知道这个错误在哪里,我会感谢你
鲍里斯 THX
答案 0 :(得分:2)
在您main
user.rb