わかりました。次のようなすべてのタイプのnamed_scopeが必要です。
class Variety < ActiveRecord::Base
TYPES = ["holiday", "party", "other", yet_another]
Variety::TYPES.each do |role|
define_method
scope "#{role.to_sym}_applications", where(:type => role)
end
end
end
基本的に、名前付きスコープをプログラムでメタ定義して、これを実行できるようにします。
Variety.holiday_applications
Variety.party_applications
Variety.other_applications
Variety.yet_another_applications
私がdefineメソッドで何を間違っているのか考えてみてください