I suspect the problem is that you are missing s after the generator. The correct method call:
Rails::Generators::GeneratedAttribute.new
, , initialize. :
def initialize(*args, &block)
super
end
, column_name: column_type, :
class FooGenerator < Rails::Generators::NamedBase
argument :model_attributes, type: :array, default: [], banner: "model:attributes"
def initialize(*args, &block)
super
@attributes = []
model_attributes.each do |attribute|
@attributes << Rails::Generators::GeneratedAttribute.new(*attribute.split(":")) if attribute.include?(":")
end
end
end
, , - . , . !