Sha256: 76b69253ef0d16650c12171f6fa51fbc16aacec418b11fdd620dfe04b0464dde

Contents?: true

Size: 626 Bytes

Versions: 3

Compression:

Stored size: 626 Bytes

Contents

require 'rails/generators/resource_helpers'
module Guard
  class ScaffoldGenerator < Rails::Generators::NamedBase
    include Rails::Generators::ResourceHelpers

    source_root File.expand_path('../templates', __FILE__)
    
#    check_class_collision :suffix => "Guard"
    
    def create_guard_files
      template 'guard.rb', File.join('app', 'guards', class_path, "#{plural_file_name}_guard.rb")
    end
    
    def guard_class_name
      controller_class_name
    end

    def aliases
      { :create=>:new, :update=>:edit }
    end

    def actions
      ['index', 'show', 'new', 'edit', 'destroy']
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ixtlan-guard-0.5.0 lib/generators/guard/scaffold/scaffold_generator.rb
ixtlan-guard-0.4.1 lib/generators/guard/scaffold/scaffold_generator.rb
ixtlan-guard-0.4.0 lib/generators/guard/scaffold/scaffold_generator.rb