Sha256: 7ee5b00fd81efe905495b964f467e25a1ba7fe5f6c7bdf7d976e17293fed4ccc

Contents?: true

Size: 755 Bytes

Versions: 1

Compression:

Stored size: 755 Bytes

Contents

require 'rails/generators/named_base'

module ReleaseNotes
  module Generators
    class ReleaseNotesGenerator < Rails::Generators::NamedBase
      include Rails::Generators::ResourceHelpers

      namespace "release_notes"
      source_root File.expand_path("../templates", __FILE__)

      desc "Generates a model with the given NAME (if one does not exist) with " <<
           "release_notes configuration plus a migration file and release_notes routes."

      hook_for :orm

      class_option :routes, :desc => "Generate routes", :type => :boolean, :default => true

      def add_release_notes_routes
        release_notes_routes = "mount ReleaseNotes::Engine, at: '/#{plural_name}'"

        route release_notes_routes
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
release_notes-0.1.3 lib/generators/release_notes/release_notes_generator.rb