diff options
author | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2009-12-07 23:25:41 +0100 |
---|---|---|
committer | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2009-12-07 23:25:41 +0100 |
commit | c12e150b1f22c290490c01de19ab8e11df8ab0db (patch) | |
tree | 61691d489e4d8f36ac46263261331968b8695ac4 /hash.rb | |
parent | 48cd11e7ce34348bc91b144ffbcd46e0e90a8bc0 (diff) |
fix db index issue
Diffstat (limited to 'hash.rb')
-rw-r--r-- | hash.rb | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -18,6 +18,12 @@ ############################################################################ class Hash + #################################################### + # compare self with other hash # + # in the order of fieldarray # + # {1=>a,2=>b}.compare_by_values({1=>c,2=>d},[2,1]) # + # -> compares b,d and afterwards a,c # + #################################################### def compare_by_values(other, fieldarray) return 0 if fieldarray.size == 0 return 1 if self[fieldarray[0]].nil? |