At the point some_custom_method
is called, attributes are already set (via ARGV
) and by checking the code I don't see a clear way to alter them from there. You can use another approach by overriding start
class method in your generator and manipulate the args directly, like this:
class ViewGenerator < Rails::Generators::NamedBase
# your code ...
def self.start(args, config)
args.insert(1, 'description:integer') # 0 being the view name
super
end
end