app/models/page_serializer.rb
# TODO: it's re-reading those roles waaaaay too often. Cache.
it's re-reading those roles waaaaay too often. Cache.
it ' s re - reading those roles waaaaay too often . Cache .
def build_attributions(data_object)
      attributions = []
      data_object.agents_data_objects.each do |attrib|
        url = nil
        url = attrib.agent.homepage if
          attrib.agent.homepage && attrib.agent.homepage =~ /^htt/
        attributions << { role: attrib.agent_role.label, url: url,
          value: attrib.agent.full_name }
      end
      attributions
    end
def build_attributions ( data_object ) attributions = [ ] data_object . agents_data_objects . each do | attrib | url = nil url = attrib . agent . homepage if attrib . agent . homepage && attrib . agent . homepage =~ / ^htt / attributions << { role : attrib . agent_role . label , url : url , value : attrib . agent . full_name } end attributions end
TODO: it's re-reading those roles waaaaay too often.
TODO : it ' s re - reading those roles waaaaay too often .
data_object
<not_specific>