Class: Guard::ScaffoldGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
Rails::Generators::ResourceHelpers
Defined in:
lib/generators/guard/scaffold/scaffold_generator.rb

Instance Method Summary collapse

Instance Method Details

#actionsObject

TODO should be coming from the actual generator



15
16
17
# File 'lib/generators/guard/scaffold/scaffold_generator.rb', line 15

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

#create_guard_filesObject

check_class_collision :suffix => “Guard”



10
11
12
# File 'lib/generators/guard/scaffold/scaffold_generator.rb', line 10

def create_guard_files
  template 'guard.yml', File.join('app', 'guards', class_path, "#{plural_file_name}_guard.yml")
end