0
has_many relationとclass_nameオプションを持つRoRモデルの場合はベストプラクティスです。シンボル、例えば文字列またはクラスhas_many relationとclass_nameオプションを持つRoRモデル。シンボル対文字列vsクラス
:
class Customer < ActiveRecord::Base
# as symbol
has_many :invoices, class_name: :CustomerInvoices
# as string
has_many :invoices, class_name: "CustomerInvoices"
# as symbol
has_many :invoices, class_name: CustomerInvoices
end
私は、各コードバリアントをテストし、それが同じように(明らかに)で動作します。
一貫性は私の友人、thxです。 ;) –