Modified: branches/wf4ever/app/controllers/relationships_controller.rb (3399 => 3400)
--- branches/wf4ever/app/controllers/relationships_controller.rb 2013-02-06 01:12:00 UTC (rev 3399)
+++ branches/wf4ever/app/controllers/relationships_controller.rb 2013-02-06 01:13:12 UTC (rev 3400)
@@ -29,11 +29,11 @@
# POST /:context_type/:context_id/relationships
def create
- subject_name = URI::decode(params[:subject])
- object_name = URI::decode(params[:object])
+ subject_relative_uri = URI::decode(params[:subject])
+ object_relative_uri = URI::decode(params[:object])
- subject = @context.contributable_entries.find_by_name(subject_name)
- object = @context.contributable_entries.find_by_name(object_name)
+ subject = @context.contributable_entries.find_by_relative_uri(subject_relative_uri)
+ object = @context.contributable_entries.find_by_relative_uri(object_relative_uri)
match = params[:predicate].match("(.*[#/])([^#/]+)")
@@ -42,8 +42,8 @@
session = ROSRS::Session.new(@context.ro_uri, Conf.rodl_bearer_token)
- subject_uri = "address@hidden::encode(subject.name)}"
- object_uri = "address@hidden::encode(object.name)}"
+ subject_uri = "address@hidden::encode(subject.ro_local_uri)}"
+ object_uri = "address@hidden::encode(object.ro_local_uri)}"
ao_body = <<RDF
<rdf:RDF
Modified: branches/wf4ever/app/models/pack.rb (3399 => 3400)
--- branches/wf4ever/app/models/pack.rb 2013-02-06 01:12:00 UTC (rev 3399)
+++ branches/wf4ever/app/models/pack.rb 2013-02-06 01:13:12 UTC (rev 3400)
@@ -104,13 +104,14 @@
end
end
- def find_by_name(name)
+ def find_by_relative_uri(relative_uri)
@entries.each do |entry|
- return entry if entry.name == name
+ return entry if entry.uri == @pack.ro_uri + relative_uri
end
nil
end
+
end
class Pack < ActiveRecord::Base