lib/qooxview/entity.rb in qooxview-1.9.9 vs lib/qooxview/entity.rb in qooxview-1.9.10

- old
+ new

@@ -53,29 +53,10 @@ @values = [] @data_instances = {} @default_type = :CSV @keys = {} - # Check for config of this special class - # dputs( 2 ){ "Class is: #{self.class.name.to_sym.inspect}" } - if @config = get_config(nil, :Entities, self.class.name) - #@config = $config[:Entities][self.class.name.to_sym] - dputs(3) { "Writing config #{@config.inspect} for #{self.class.name}" } - @config.each { |k, v| - dputs(3) { "Setting #{k} = #{v}" } - case v - when /true|false/ - instance_variable_set("@#{k.to_s}", eval(v)) - else - instance_variable_set("@#{k.to_s}", v) - end - self.class.send(:attr_reader, k) - } - else - @config = nil - end - # Stuff for the StorageHandler @storage = {} @data = {} @name = singular(self.class.name) @data_field_id = "#{@name}_id".downcase.to_sym @@ -372,11 +353,11 @@ start = Time.now @@all.each { |k, v| dputs(3) { "Saving #{v.class.name}" } v.save() } - dputs(2) { "Time for saving everything: #{Time.now - start}" } + dputs(3) { "Time for saving everything: #{Time.now - start}" } end def self.load_all dputs(2) { 'Loading everything' } @@all.each { |k, v| @@ -416,11 +397,11 @@ end def self.needs(entities) dputs(2) { "#{self.name} needs #{entities}" } entities = entities.to_s.to_a unless entities.class == Array - @@needs["Entities.#{self.name.to_s}"] = entities.collect{|e| + @@needs["Entities.#{self.name.to_s}"] = entities.collect { |e| "Entities.#{e}" } end end @@ -489,11 +470,10 @@ when /^listp_(.*)/ dputs(3) { "Returning listp for #{cmd} - #{$1}" } return [self.id, self.send($1)] end @show_error_missing && dputs(0) { "ValueUnknown for #{cmd.inspect} in "+ - "#{self.class.name} - " + - "#{caller.inspect} - #{@proxy.blocks.inspect}" } + "#{self.class.name} - #{caller.inspect}" } if field =~ /^_/ raise 'ValueUnknown' else return super end