From 89424dcd7f663e55b1836d0048f278a827488ee5 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Mon, 26 Oct 2015 18:28:25 +0800 Subject: [PATCH] try to fix custom metacode icon path --- app/models/metacode.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/metacode.rb b/app/models/metacode.rb index 2b23d694..5f83cb91 100644 --- a/app/models/metacode.rb +++ b/app/models/metacode.rb @@ -21,7 +21,9 @@ class Metacode < ActiveRecord::Base #output json with asset_paths merged in def as_json(options) json = super(options.merge!(methods: :asset_path_icon)) - json["icon"] = json["asset_path_icon"] unless json["icon"].start_with?('http') + unless json["icon"].start_with?('http') + json["icon"] = json["asset_path_icon"] + end json.except("asset_path_icon") end end