Sha256: a6280dd05e7b22c996face4836bc506884a2e2e30e2384fc47bddaa3bd90cc50

Contents?: true

Size: 533 Bytes

Versions: 1

Compression:

Stored size: 533 Bytes

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
adhoc-generators-0.0.1 lib/generators/adhoc/portfolio/portfolio_generator.rb