Skip to content

Commit

Permalink
handle getting all the attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
imadbourouche committed Feb 22, 2025
1 parent 6ca9cd1 commit eab37dc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions controllers/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ class HomeController < ApplicationController
routes_hash[route_no_slash] = LinkedData.settings.rest_url_prefix + route_no_slash
end

catalog = LinkedData::Models::SemanticArtefactCatalog.all.first || create_catalog
catalog.bring(*LinkedData::Models::SemanticArtefactCatalog.goo_attrs_to_load(includes_param))
catalog_class = LinkedData::Models::SemanticArtefactCatalog
catalog = catalog_class.all.first || create_catalog
attributes_to_include = includes_param[0] == :all ? catalog_class.attributes(:all) : catalog_class.goo_attrs_to_load(includes_param)
catalog.bring(*attributes_to_include)
if catalog.loaded_attributes.include?(:federated_portals)
catalog.federated_portals = catalog.federated_portals.map { |item| JSON.parse(item.gsub('=>', ':').gsub('\"', '"')) }
catalog.federated_portals.each { |item| item.delete('apikey') }
Expand Down

0 comments on commit eab37dc

Please sign in to comment.