Simplify the code
This commit is contained in:
parent
1bd2327c31
commit
f5c9a40989
1 changed files with 2 additions and 6 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue