Sha256: fa913e0f9c48a37d2317f4cc66c39ea76ea2eedd858efccf4642c4361c828f45

Contents?: true

Size: 959 Bytes

Versions: 7

Compression:

Stored size: 959 Bytes

Contents

require 'generators/acts_as_approvable/base'

module Erb
  module Generators
    class ActsAsApprovableGenerator < Rails::Generators::Base
      include ActsAsApprovable::Generators::Base

      source_root File.expand_path('../templates', __FILE__)

      class_option :owner, :type => :string, :optional => true, :desc => 'Model that can own approvals'
      class_option :scripts, :type => :boolean, :optional => true, :default => false

      def copy_view_files
        template 'index.html.erb',          'app/views/approvals/index.html.erb'
        template '_table.html.erb',         'app/views/approvals/_table.html.erb'
        template '_owner_select.html.erb',  'app/views/approvals/_owner_select.html.erb' if owner?
      end

      protected
      def format
        :html
      end

      def handler
        :erb
      end

      def filename_with_extensions(name)
        [name, format, handler].compact.join('.')
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
acts_as_approvable-0.7.0 lib/generators/erb/acts_as_approvable_generator.rb
acts-as-approvable-0.6.9.1 lib/generators/erb/acts_as_approvable_generator.rb
acts-as-approvable-0.6.9 lib/generators/erb/acts_as_approvable_generator.rb
acts-as-approvable-0.6.8.1 lib/generators/erb/acts_as_approvable_generator.rb
acts-as-approvable-0.6.7 lib/generators/erb/acts_as_approvable_generator.rb
acts-as-approvable-0.6.6 lib/generators/erb/acts_as_approvable_generator.rb
acts-as-approvable-0.6.5 lib/generators/erb/acts_as_approvable_generator.rb