BigW Consortium Gitlab

Commit f5c9a409 by Lin Jen-Shin

Simplify the code

parent 1bd2327c
...@@ -26,14 +26,10 @@ class Admin::ServicesController < Admin::ApplicationController ...@@ -26,14 +26,10 @@ class Admin::ServicesController < Admin::ApplicationController
private private
def services_templates def services_templates
templates = [] Service.available_services_names.map do |service_name|
Service.available_services_names.each do |service_name|
service_template = service_name.concat("_service").camelize.constantize service_template = service_name.concat("_service").camelize.constantize
templates << service_template.where(template: true).first_or_create service_template.where(template: true).first_or_create
end end
templates
end end
def service def service
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment