Feature #489

avatar

Optimize datastreams method

Added by Matt Zumwalt 315 days ago. Updated 311 days ago.

Status:Closed Start:09/17/2009
Priority:Normal Due date:
Assigned to:- % Done:

0%

Category:- Spent time: 2.00 hours
Target version:1.0.7
Sponsor:


Description

Base.datastreams should never hit Fedora.

Populate @datastreams hash when initializing objects, provide a method for updating datastreams from Fedora.

History

Updated by Matt Zumwalt 315 days ago

avatar

Try this:

def datastreams
if @new_object
@datastreams = datastreams_in_memory
else
@datastreams = (@datastreams == {}) ? datastreams_in_fedora : datastreams_in_memory
#@datastreams = datastreams_in_fedora.merge(datastreams_in_memory)
end

end

... will break some specs. Either hack the spec with

@test_object.instance_variable_set(:@datastreams, @test_object.datastreams_in_fedora)

... or fix Base.save to update the datastreams hash after saving

@datastreams = datastreams_in_fedora

see http://pastie.org/621119 for samples of fixed Base methods

Updated by Matt Zumwalt 314 days ago

avatar
  • Target version changed from 2.0 Release: MODS, Nokogiri & better Solr to 1.0.7

Updated by Matt Zumwalt 311 days ago

avatar
  • Status changed from New to Closed

Also available in: Atom PDF