remove redundant asset_path_icon function
This commit is contained in:
parent
b2aa2074a7
commit
df485002b1
2 changed files with 1 additions and 9 deletions
|
@ -10,7 +10,7 @@ module TopicsHelper
|
||||||
topic['value'] = t.name
|
topic['value'] = t.name
|
||||||
topic['description'] = t.desc.truncate(70) # make this return matched results
|
topic['description'] = t.desc.truncate(70) # make this return matched results
|
||||||
topic['type'] = t.metacode.name
|
topic['type'] = t.metacode.name
|
||||||
topic['typeImageURL'] = t.metacode.asset_path_icon
|
topic['typeImageURL'] = t.metacode.icon
|
||||||
topic['permission'] = t.permission
|
topic['permission'] = t.permission
|
||||||
topic['mapCount'] = t.maps.count
|
topic['mapCount'] = t.maps.count
|
||||||
topic['synapseCount'] = t.synapses.count
|
topic['synapseCount'] = t.synapses.count
|
||||||
|
|
|
@ -14,14 +14,6 @@ class Metacode < ActiveRecord::Base
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
def asset_path_icon
|
|
||||||
if icon.start_with?('http')
|
|
||||||
icon
|
|
||||||
else
|
|
||||||
ActionController::Base.helpers.asset_path icon
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
#output json with asset_paths merged in
|
#output json with asset_paths merged in
|
||||||
def as_json(options)
|
def as_json(options)
|
||||||
json = super(options.merge!(methods: :asset_path_icon))
|
json = super(options.merge!(methods: :asset_path_icon))
|
||||||
|
|
Loading…
Reference in a new issue