Modified: branches/packs/app/models/resource.rb (3625 => 3626)
--- branches/packs/app/models/resource.rb 2013-08-23 13:39:45 UTC (rev 3625)
+++ branches/packs/app/models/resource.rb 2013-08-23 13:40:34 UTC (rev 3626)
@@ -9,12 +9,16 @@
include ResearchObjectsHelper
+ before_save :set_uuid
+
before_save :copy_metadata
belongs_to :research_object
belongs_to :content_blob, :dependent => :destroy
+ has_one :pack_contributable_entry
+
def proxy_for
research_object.resources.find(:first,
:conditions => { :path => proxy_for_path } )
@@ -249,6 +253,10 @@
end
end
+ def set_uuid
+ self.uuid = SecureRandom.uuid
+ end
+
def update_manifest!
research_object.update_manifest!
end
Modified: branches/packs/db/migrate/20130520145900_create_research_objects.rb (3625 => 3626)
--- branches/packs/db/migrate/20130520145900_create_research_objects.rb 2013-08-23 13:39:45 UTC (rev 3625)
+++ branches/packs/db/migrate/20130520145900_create_research_objects.rb 2013-08-23 13:40:34 UTC (rev 3626)
@@ -24,6 +24,7 @@
t.text "path"
t.string "entry_name"
t.string "creator_uri"
+ t.string "uuid", :limit => 36
t.string "proxy_in_path"
t.string "proxy_for_path"
t.string "ao_body_path"