17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/generators/reativo/reativo_generator.rb', line 17
def generate_operations
representer_module = false
actions = options['actions'] || []
actions = ['index', 'create', 'show', 'update', 'destroy'] if options[:crud]
actions.each do |action|
template "operation/#{action}.erb", concept_path("operation", action) if has_operation?(action)
template "contract/#{action}.erb", concept_path("contract", action) if has_contract?(action)
if has_representer?(action)
template "representer/#{action}.erb", concept_path("representer", action)
representer_module = true
end
end
if representer_module
template "representer/module.erb", concept_path("representer", "#{model_name.underscore}_module")
end
end
|