Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/sakai-info/hacks.rb

Overview

terrible hack to work around mysql case issues essentially, if the hash key asked for is a symbol and its value is nil, then try again with the uppercased version of the symbol this might cause problems in weird cases with other hashes, this is definitely not a sustainable fix. TODO: patch Sequel for case-insensitive/-fixed identifiers

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/sakai-info/hacks.rb', line 29

def [](key)
  if not (value = original_brackets(key)).nil?
    return value
  else
    if key.is_a? Symbol
      return original_brackets(key.to_s.upcase.to_sym)
    else
      return nil
    end
  end
end

#original_bracketsObject



27
# File 'lib/sakai-info/hacks.rb', line 27

alias :original_brackets :[]