lib/active_fedora/base.rb in active-fedora-6.6.0.rc5 vs lib/active_fedora/base.rb in active-fedora-6.6.0
- old
+ new
@@ -69,15 +69,10 @@
def marked_for_destruction?
@marked_for_destruction
end
- def reload(options = nil)
- @marked_for_destruction = false
- super
- end
-
# Constructor. You may supply a custom +:pid+, or we call the Fedora Rest API for the
# next available Fedora pid, and mark as new object.
# Also, if +attrs+ does not contain +:pid+ but does contain +:namespace+ it will pass the
# +:namespace+ value to Fedora::Repository.nextid to generate the next pid available within
# the given namespace.
@@ -94,9 +89,10 @@
run_callbacks :initialize
end
# Reloads the object from Fedora.
def reload
+ raise ActiveFedora::ObjectNotFoundError, "Can't reload an object that hasn't been saved" unless persisted?
clear_association_cache
init_with(self.class.find(self.pid, cast: false).inner_object)
end
# Initialize an empty model object and set the +inner_obj+