From 684dcd8d336568e0d23325d9945f53f7ab480761 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Mon, 26 Oct 2015 12:12:07 +0800 Subject: [PATCH] only run metacode.icon through asset_path if the path doesn't start with http --- app/models/metacode.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/metacode.rb b/app/models/metacode.rb index b404ad5f..a545a428 100644 --- a/app/models/metacode.rb +++ b/app/models/metacode.rb @@ -21,7 +21,7 @@ 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"] + json["icon"] = json["asset_path_icon"] if json["icon"].start_with?('http') json.except("asset_path_icon") end end