aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-07-30 19:05:41 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-07-30 19:05:41 -0700
commit34303cc6176f47c1359a2fca8f50365e601509f0 (patch)
tree64b663f68b1ced77746811426e27e5994e6cdcbc
parent020b03749fff4b1fcea52553846ece822ea8e840 (diff)
downloadrails-34303cc6176f47c1359a2fca8f50365e601509f0.tar.gz
rails-34303cc6176f47c1359a2fca8f50365e601509f0.tar.bz2
rails-34303cc6176f47c1359a2fca8f50365e601509f0.zip
removing module for faster method lookup
-rw-r--r--lib/arel/algebra/expression.rb23
-rw-r--r--spec/algebra/unit/primitives/expression_spec.rb2
2 files changed, 11 insertions, 14 deletions
diff --git a/lib/arel/algebra/expression.rb b/lib/arel/algebra/expression.rb
index 5a93ca9735..f7ba57a757 100644
--- a/lib/arel/algebra/expression.rb
+++ b/lib/arel/algebra/expression.rb
@@ -20,20 +20,17 @@ module Arel
formatter.expression self
end
- module Transformations
- def as(aliaz)
- self.class.new(attribute, aliaz, self)
- end
-
- def bind(new_relation)
- new_relation == relation ? self : self.class.new(attribute.bind(new_relation), @alias, self)
- end
-
- def to_attribute(relation)
- Attribute.new(relation, @alias, :ancestor => self)
- end
+ def as(aliaz)
+ self.class.new(attribute, aliaz, self)
+ end
+
+ def bind(new_relation)
+ new_relation == relation ? self : self.class.new(attribute.bind(new_relation), @alias, self)
+ end
+
+ def to_attribute(relation)
+ Attribute.new(relation, @alias, :ancestor => self)
end
- include Transformations
end
class Count < Expression
diff --git a/spec/algebra/unit/primitives/expression_spec.rb b/spec/algebra/unit/primitives/expression_spec.rb
index 483817f735..f95ef69f96 100644
--- a/spec/algebra/unit/primitives/expression_spec.rb
+++ b/spec/algebra/unit/primitives/expression_spec.rb
@@ -7,7 +7,7 @@ module Arel
@attribute = @relation[:id]
end
- describe Expression::Transformations do
+ describe 'Expression::Transformations' do
before do
@expression = Count.new(@attribute)
end