Class: Effective::Generators::ScaffoldGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Effective::Generators::ScaffoldGenerator
- Includes:
- Helpers
- Defined in:
- lib/generators/effective/scaffold_generator.rb
Instance Method Summary collapse
- #invoke_ability ⇒ Object
- #invoke_controller ⇒ Object
- #invoke_datatable ⇒ Object
- #invoke_form ⇒ Object
- #invoke_menu ⇒ Object
- #invoke_migration ⇒ Object
- #invoke_model ⇒ Object
- #invoke_route ⇒ Object
- #invoke_views ⇒ Object
Instance Method Details
#invoke_ability ⇒ Object
40 41 42 |
# File 'lib/generators/effective/scaffold_generator.rb', line 40 def invoke_ability Rails::Generators.invoke('effective:ability', [name] + invoked_actions) end |
#invoke_controller ⇒ Object
32 33 34 |
# File 'lib/generators/effective/scaffold_generator.rb', line 32 def invoke_controller Rails::Generators.invoke('effective:controller', [name] + invoked_actions + invoked_attributes_args) end |
#invoke_datatable ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/generators/effective/scaffold_generator.rb', line 48 def invoke_datatable unless invoked_actions.include?('index') say_status(:skipped, :datatable, :yellow) and return end Rails::Generators.invoke('effective:datatable', [name] + invoked_actions + invoked_attributes_args) end |
#invoke_form ⇒ Object
60 61 62 63 64 65 66 |
# File 'lib/generators/effective/scaffold_generator.rb', line 60 def invoke_form unless invoked_actions.include?('new') || invoked_actions.include?('edit') say_status(:skipped, :form, :yellow) and return end Rails::Generators.invoke('effective:form', [name] + invoked_attributes_args) end |
#invoke_menu ⇒ Object
44 45 46 |
# File 'lib/generators/effective/scaffold_generator.rb', line 44 def Rails::Generators.invoke('effective:menu', [name]) end |
#invoke_migration ⇒ Object
28 29 30 |
# File 'lib/generators/effective/scaffold_generator.rb', line 28 def invoke_migration Rails::Generators.invoke('effective:migration', [name] + invokable(invoked_attributes)) end |
#invoke_model ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/generators/effective/scaffold_generator.rb', line 20 def invoke_model if File.exist?(resource.model_file) say_status(:skipped, :model, :yellow) and return end Rails::Generators.invoke('effective:model', [name] + invokable(invoked_attributes)) end |
#invoke_route ⇒ Object
36 37 38 |
# File 'lib/generators/effective/scaffold_generator.rb', line 36 def invoke_route Rails::Generators.invoke('effective:route', [name] + invoked_actions) end |
#invoke_views ⇒ Object
56 57 58 |
# File 'lib/generators/effective/scaffold_generator.rb', line 56 def invoke_views Rails::Generators.invoke('effective:views', [name] + invoked_actions + invoked_attributes_args) end |