From bdb5623a02d136ae8351a7e0fdfb148a8be1a052 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Mon, 26 Oct 2015 11:53:54 +0800 Subject: [PATCH] woot fix metacodes --- app/models/metacode.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/models/metacode.rb b/app/models/metacode.rb index 03b0f0c0..b404ad5f 100644 --- a/app/models/metacode.rb +++ b/app/models/metacode.rb @@ -13,4 +13,15 @@ class Metacode < ActiveRecord::Base return true if self.metacode_sets.include? metacode_set return false end + + def asset_path_icon + ActionController::Base.helpers.asset_path icon + end + + #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.except("asset_path_icon") + end end