require 'generators/adhoc' require 'rails/generators/migration' require 'rails/generators/generated_attribute' module Adhoc module Generators class PortfolioGenerator < Base argument :class_name, type: :string, default: 'portfolio', banner: 'portfolio_name' def create_config template "portfolio.rb", "app/models/#{file_name}.rb" end private def file_name class_name.underscore end def constant_name class_name.underscore.upcase end end end end