lib/generators/guard/scaffold/scaffold_generator.rb in ixtlan-guard-0.5.0 vs lib/generators/guard/scaffold/scaffold_generator.rb in ixtlan-guard-0.6.0

- old
+ new

@@ -1,26 +1,19 @@ require 'rails/generators/resource_helpers' module Guard class ScaffoldGenerator < Rails::Generators::NamedBase include Rails::Generators::ResourceHelpers - source_root File.expand_path('../templates', __FILE__) + 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") + template 'guard.yml', File.join('app', 'guards', class_path, "#{plural_file_name}_guard.yml") end - - def guard_class_name - controller_class_name - end - - def aliases - { :create=>:new, :update=>:edit } - end - + + #TODO should be coming from the actual generator def actions - ['index', 'show', 'new', 'edit', 'destroy'] + ['index', 'show', 'new', 'create', 'edit', 'update', 'destroy'] end end end