def save!
self.save or raise Exception.new("Save failed")
end
- def metadata(*args)
+ def links(*args)
o = {}
o.merge!(args.pop) if args[-1].is_a? Hash
- o[:metadata_class] ||= args.shift
+ o[:link_class] ||= args.shift
o[:name] ||= args.shift
o[:head_kind] ||= args.shift
o[:tail_kind] = self.kind
- o[:tail] = self.uuid
- if all_metadata
- return all_metadata.select do |m|
+ o[:tail_uuid] = self.uuid
+ if all_links
+ return all_links.select do |m|
ok = true
o.each do |k,v|
if !v.nil?
ok
end
end
- @metadata = $orvos_api_client.api Metadatum, '', { _method: 'GET', where: o, eager: true }
- @metadata = $orvos_api_client.unpack_api_response(@metadata)
+ @links = $orvos_api_client.api Link, '', { _method: 'GET', where: o, eager: true }
+ @links = $orvos_api_client.unpack_api_response(@links)
end
- def all_metadata
- return @all_metadata if @all_metadata
- res = $orvos_api_client.api Metadatum, '', {
+ def all_links
+ return @all_links if @all_links
+ res = $orvos_api_client.api Link, '', {
_method: 'GET',
where: {
tail_kind: self.kind,
- tail: self.uuid
+ tail_uuid: self.uuid
},
eager: true
}
- @all_metadata = $orvos_api_client.unpack_api_response(res)
+ @all_links = $orvos_api_client.unpack_api_response(res)
end
def reload
private_reload(self.uuid)
end
end
end
- @all_metadata = nil
+ @all_links = nil
self
end
def dup
resources :pipeline_invocations
- resources :metadata
+ resources :links
resources :collections
# Send unroutable requests to an arbitrary controller
# (ends up at ApplicationController#render_not_found)
- match '*a', :to => 'metadata#render_not_found'
+ match '*a', :to => 'links#render_not_found'
# The priority is based upon order of creation: