45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/generators/reativo/op_generator.rb', line 45
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", "#{representer_path(model_name)}_module")
end
end
|