Sha256: 006ff4dc7214d284508c669c9ce4a065ee7891677d57c09ed70b51222e894c07

Contents?: true

Size: 967 Bytes

Versions: 7

Compression:

Stored size: 967 Bytes

Contents

require 'generators/acts_as_approvable/base'

module Haml
  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.haml',          'app/views/approvals/index.html.haml'
        template '_table.html.haml',         'app/views/approvals/_table.html.haml'
        template '_owner_select.html.haml',  'app/views/approvals/_owner_select.html.haml' if owner?
      end

      protected
      def format
        :html
      end

      def handler
        :haml
      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/haml/acts_as_approvable_generator.rb
acts-as-approvable-0.6.9.1 lib/generators/haml/acts_as_approvable_generator.rb
acts-as-approvable-0.6.9 lib/generators/haml/acts_as_approvable_generator.rb
acts-as-approvable-0.6.8.1 lib/generators/haml/acts_as_approvable_generator.rb
acts-as-approvable-0.6.7 lib/generators/haml/acts_as_approvable_generator.rb
acts-as-approvable-0.6.6 lib/generators/haml/acts_as_approvable_generator.rb
acts-as-approvable-0.6.5 lib/generators/haml/acts_as_approvable_generator.rb