的多個名字,我有這個模型Ruby on Rails的 - 定義模式或表
class Oferta < ActiveRecord::Base
belongs_to :entidade
has_many :candidatos, :through => :interesses
has_many :interesses, foreign_key: "oferta_id", dependent: :destroy
基本上我有這個模型和模型Interesse
及其複數其interesses
但我認爲Rails的是在實際起飛的es
結束並讓我與Interess。現在,它給了我這個錯誤:
uninitialized constant Oferta::Interess
我如何定義的單數interesses
是interesse
?而不是interess
請參閱http://stackoverflow.com/questions/1185035/how-do-i-override-rails-naming-conventions – 2014-08-28 08:52:59
有用的鏈接。謝謝! – Lokuzt 2014-08-28 08:58:06