这是这样的:
class Prijave < ActiveRecord::Base
belongs_to :timovi
belongs_to :liga
end
class Timovi < ActiveRecord::Base
belongs_to :sportovi
has_many :timoviusers, :dependent => :destroy
has_many :prijaves, :dependent => :destroy
end
当我试图删除一个 Timovi 时,我得到:未初始化的常量 Timovi::Prijafe
另外,在控制台
1.9.3p194 :001 > a=Timovi.find(6)
Timovi Load (0.2ms) SELECT `timovis`.* FROM `timovis` WHERE `timovis`.`id` = 6 LIMIT 1
1.9.3p194 :007 > a.prijaves
NameError: uninitialized constant Timovi::Prijafe
普里哈菲斯?我没有在任何地方声明...我在任何地方都没有...错误?我做错了什么吗?谢谢