lib/qooxview/storage_handler.rb in qooxview-1.9.11 vs lib/qooxview/storage_handler.rb in qooxview-1.9.13.pre.10

- old
+ new

@@ -215,10 +215,11 @@ end return {@data_field_id => @last_id} end def create(args, allow_double = false) + # dputs_func oldload = @loading @loading = true if args.class != Hash dputs(0) { "Entities.create takes a hash! You gave a #{args.class}" } exit @@ -261,11 +262,11 @@ return nil end end def save_data(d) - #dputs_func + # dputs_func dputs(5) { "Saving #{d.inspect}" } d.to_sym! if d.has_key? @data_field_id # Assure that the data_field_id is an integer dputs(5) { 'Has key' } @@ -290,10 +291,14 @@ def delete_id(id) id = id.to_i dputs(3) { "Deleting id #{id}" } @data.delete(id) @data_instances.delete(id) + @storage.each{|k, di| + di.delete id + } + @changed = true end def set_entry(id, field, v) #dputs_func value = if v.is_a? Entity @@ -414,10 +419,10 @@ @data = {} @data_instances = {} @keys = {} @storage.each { |k, di| dputs(5) { "Loading #{k} at #{di.name} with #{di.inspect}" } - @data.merge!(di.load) { |k, o, n| o.merge(n) } + @data.merge!(di.load) { |_, o, n| o.merge(n) } dputs(5) { "Loaded #{@data.inspect} for #{self.name}" } } if @data.length == 0 && respond_to?(:init) dputs(1) { "Calling init for #{self.name}" } init