From bc4d913200d17da751f9b1d9bad78cb94173a4cb Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Sun, 25 Jul 2010 18:25:47 -0700 Subject: do not use a module as it slows down method lookup --- lib/arel/algebra/core_extensions/hash.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'lib/arel/algebra') diff --git a/lib/arel/algebra/core_extensions/hash.rb b/lib/arel/algebra/core_extensions/hash.rb index c64225f685..82cd5e11d3 100644 --- a/lib/arel/algebra/core_extensions/hash.rb +++ b/lib/arel/algebra/core_extensions/hash.rb @@ -1,11 +1,7 @@ -module Arel - module HashExtensions - def bind(relation) - inject({}) do |bound, (key, value)| - bound.merge(key.bind(relation) => value.bind(relation)) - end +class Hash + def bind(relation) + inject({}) do |bound, (key, value)| + bound.merge(key.bind(relation) => value.bind(relation)) end - - Hash.send(:include, self) end end -- cgit v1.2.3