Module | Sequel::Plugins::SplitValues::InstanceMethods |
In: |
lib/sequel/plugins/split_values.rb
|
If there isn‘t an entry in the values hash, but there is a noncolumn_values hash, look in that hash for the value.
# File lib/sequel/plugins/split_values.rb, line 49 49: def [](k) 50: if (res = super).nil? 51: @noncolumn_values[k] if !@values.has_key?(k) && @noncolumn_values 52: else 53: res 54: end 55: end
Check all entries in the values hash. If any of the keys are not columns, move the entry into the noncolumn_values hash.
# File lib/sequel/plugins/split_values.rb, line 59 59: def split_noncolumn_values 60: cols = (@values.keys - columns) 61: return self if cols.empty? 62: 63: nc = @noncolumn_values ||= {} 64: vals = @values 65: cols.each{|k| nc[k] = vals.delete(k)} 66: self 67: end