lib/ohm.rb in ohm-0.0.35 vs lib/ohm.rb in ohm-0.0.36

- old
+ new

@@ -7,11 +7,11 @@ require File.join(File.dirname(__FILE__), "ohm", "compat-1.8.6") require File.join(File.dirname(__FILE__), "ohm", "key") require File.join(File.dirname(__FILE__), "ohm", "collection") module Ohm - VERSION = "0.0.35" + VERSION = "0.0.36" # Provides access to the Redis database. This is shared accross all models and instances. def redis threaded[:redis] ||= connection(*options) end @@ -704,10 +704,18 @@ db.mapped_mset(adds.flatten) unless adds.empty? end end def self.const_missing(name) - Wrapper.new(name) { const_get(name) } + wrapper = Wrapper.new(name) { const_get(name) } + + # Allow others to hook to const_missing. + begin + super(name) + rescue NameError + end + + wrapper end private # Provides access to the Redis database. This is shared accross all models and instances.