You cannot pass arguments to a module. In fact, you cannot pass arguments for anything other than sending a message.
So you should use message sending:
module Kernel private def Assetable(num) @__assetable_cache__ ||= [] @__assetable_cache__[num] ||= Module.new do num.times do |i| attr_accessor :"asset_#{i}" attr_accessible :"asset_#{i}" end end end end class Foo include Assetable 3 end
Note. I did not understand why you need ActiveSupport::Concern here at all, but it is easy to add it back.
Jรถrg W Mittag
source share