Skip to content

Instantly share code, notes, and snippets.

@zdavatz
Created March 14, 2011 09:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zdavatz/868953 to your computer and use it in GitHub Desktop.
Save zdavatz/868953 to your computer and use it in GitHub Desktop.
cache_entry.rb
def odba_retire opts={}
# replace with stubs in accessed_by
instance = _odba_object
if opts[:force]
@accessed_by.each do |object_id, odba_id|
if item = odba_id2ref(odba_id)
item.odba_stubize instance, opts
elsif(item = object_id2ref(object_id, odba_id))
if item.is_a?(Persistable) && !item.is_a?(Stub)
item.odba_stubize instance, opts
end
end
end
@accessed_by.clear
@odba_object = nil
else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment