Ruby on rails 有很多关联不尊重自定义屈折符

Ruby on rails 有很多关联不尊重自定义屈折符,ruby-on-rails,ruby-on-rails-3,inflection,Ruby On Rails,Ruby On Rails 3,Inflection,我有一个叫reason_to_sell的模型。Ruby将使其多元化,以使其合理销售,因此我添加了以下内容: ActiveSupport::Inflector.inflections do |inflect| inflect.plural 'reason_to_sell', 'reasons_to_sell' end 这在控制台中非常有效: ruby-1.8.7-p302 > "reason_to_sell".pluralize => "reasons_to_sell" 每个

我有一个叫reason_to_sell的模型。Ruby将使其多元化,以使其合理销售,因此我添加了以下内容:

ActiveSupport::Inflector.inflections do |inflect|
  inflect.plural 'reason_to_sell', 'reasons_to_sell'
end
这在控制台中非常有效:

ruby-1.8.7-p302 > "reason_to_sell".pluralize
 => "reasons_to_sell"
每个销售原因都属于一个用户:

class ReasonToSell < ActiveRecord::Base
  belongs_to :user
但如果我改变用户,使其有很多理由进行销售,情况就会好转:

ruby-1.8.7-p302 > u=User.first ; u.reason_to_sells
 => [] 
那么,我需要做什么才能找到销售屈折变化的原因来处理此模型关联?

使用:

has_many :reasons_to_sell, :class_name => "ReasonToSell"

谢谢Jakub。对于其他人,请在此处查看支持的选项:
ruby-1.8.7-p302 > u=User.first ; u.reason_to_sells
 => [] 
has_many :reasons_to_sell, :class_name => "ReasonToSell"