<< | Index | >>
ODDB::Divison class include SequenceObserver
ch.oddb> Divison.new.sequences -> [] ch.oddb> sequences.values.first.division.nil? -> true
I created updation/creation by pointer.
Sequence model has to have following methods.
def create_division div = Division.new div.add_sequence self @division = div div end
def division=(division) super(division) @division = replace_observer(@division, division) end
And doesn't have to implement.
def division @division || Division.new end
Sequences can pointer to same Division Object. (like patinfo,fachinfo)
ch.oddb> registration('31706').sequence('02').division -> #<ODDB::Division:0x0000000d5cf028> ch.oddb> registration('31706').sequence('02').division.odba_id -> 28770673 ch.oddb> registration('31706').sequence('01').division.odba_id -> 28770673