私のアプリケーションは、次のような多態的な関係を使用しています。
class Child < ActiveRecord:Base
belongs_to :child_owner, polymorphic: true
end
class Parent < ActiveRecord:Base
has_many :children, as: :child_owner, dependent: :destroy
end
この設定はうまくいきます。ただし、の属性名を の:children
ような複数単語変数に変更すると、初期化されて:kids_of_parent
いない定数例外が発生します (Parent::KidsOfParent の場合)。私の場合、マルチワード変数の方がはるかに説明的です。私は何を間違っていますか?誰かが少なくともこの動作を確認できますか?
ありがとう、
クリス
Ruby 1.9.3 で Rails 3.2.8 を使用する