From afcfe97517f6c0c872c0eb79fc505cf85b1a3e74 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 28 Jul 2010 13:55:22 -0700 Subject: speed up method lookup and reduce API footprint --- lib/arel/algebra/attributes/attribute.rb | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'lib/arel') diff --git a/lib/arel/algebra/attributes/attribute.rb b/lib/arel/algebra/attributes/attribute.rb index 90a3b13938..50d79fa4b9 100644 --- a/lib/arel/algebra/attributes/attribute.rb +++ b/lib/arel/algebra/attributes/attribute.rb @@ -43,24 +43,21 @@ module Arel alias :eql? :== - module Transformations - def hash - @hash ||= name.hash + root.relation.hash - end + def hash + @hash ||= name.hash + root.relation.hash + end - def as(aliaz = nil) - Attribute.new(relation, name, :alias => aliaz, :ancestor => self) - end + def as(aliaz = nil) + Attribute.new(relation, name, :alias => aliaz, :ancestor => self) + end - def bind(new_relation) - relation == new_relation ? self : Attribute.new(new_relation, name, :alias => @alias, :ancestor => self) - end + def bind(new_relation) + relation == new_relation ? self : Attribute.new(new_relation, name, :alias => @alias, :ancestor => self) + end - def to_attribute(relation) - bind(relation) - end + def to_attribute(relation) + bind(relation) end - include Transformations module Congruence def history -- cgit v1.2.3