app/models/tramea.rb
# NOTE: This is _almost_ enough to render a full data object page: all you
# need are the activities and revisions. ...And, arguably, more information
# about the associations.
This is _almost_ enough to render a full data object page: all you
need are the activities and revisions. ...And, arguably, more information
about the associations.
This is _almost_ enough to render a full data object page : all you need are the activities and revisions . ... And arguably more information about the associations .
def image_from_data_object(image, taxon = nil)
      raise "Must be an image" unless image.image?
      {
        "id" => image.id,
        "guid" => image.guid,
        "cache_id" => image.object_cache_url,
        "small_square" => image.thumb_or_object('88_88'),
        "square" => image.thumb_or_object('130_130'),
        "small" => image.thumb_or_object('98_68'),
        "large" => image.thumb_or_object,
        "title" => image.object_title,
        "source_url" => image.source_url,
        "taxa" => image.data_object_taxa.map do |assoc|
          {
            "id" => assoc.taxon_concept_id,
            "scientific_name" => assoc.hierarchy_entry.name.string,
            "trusted" => assoc.vetted_id == Vetted.trusted.id
          }
        end
      }.merge(license_from_data_object(image)).
        merge(trust_from_curatable(image, taxon))
    end
def image_from_data_object ( image , taxon = nil ) raise "Must be an image" unless image . image? { "id" => image . id , "guid" => image . guid , "cache_id" => image . object_cache_url , "small_square" => image . thumb_or_object ( '88_88' ) , "square" => image . thumb_or_object ( '130_130' ) , "small" => image . thumb_or_object ( '98_68' ) , "large" => image . thumb_or_object , "title" => image . object_title , "source_url" => image . source_url , "taxa" => image . data_object_taxa . map do | assoc | { "id" => assoc . taxon_concept_id , "scientific_name" => assoc . hierarchy_entry . name . string , "trusted" => assoc . vetted_id == Vetted . trusted . id } end } . merge ( license_from_data_object ( image ) ) . merge ( trust_from_curatable ( image , taxon ) ) end
NOTE: This is _almost_ enough to render a full data object page: all you
need are the activities and revisions.
NOTE : This is _almost_ enough to render a full data object page : all you need are the activities and revisions .
# TODO: It might be nice, here, to indicate who added the association, whether it was a ContentPartner or a curator
image
<not_specific>
taxon
<not_specific>