scaf-generator 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -20,7 +20,7 @@ class ScafGenerator < Rails::Generators::Base
|
|
20
20
|
generate("scaffold", "#{scaffold_name} #{arguments.join(' ')} --no-scaffold-controller --no-assets")
|
21
21
|
|
22
22
|
# Agrega Metodo Eliminar! al Modelo
|
23
|
-
inject_into_file
|
23
|
+
inject_into_file "app/models/#{singular_name}.rb", " def eliminar!\n update_attributes :es_activo => false\n end" , :after => /ActiveRecord::Base$/
|
24
24
|
|
25
25
|
# Agrega controller de administracion en controllers/admin/
|
26
26
|
template 'admin_controller.rb', "app/controllers/admin/#{plural_name}_controller.rb"
|