aboutsummaryrefslogtreecommitdiffstats
path: root/lib/active_relation/primitives
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-03-16 15:41:27 -0700
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-03-16 15:41:27 -0700
commited9c8d4d828fe4e28c1e37ed8921acbee54450f2 (patch)
treef650c5b558a21683e55169fbb1defe614733f725 /lib/active_relation/primitives
parent1a6a3a1c6aa2f75333edef9100951407c4f76f1f (diff)
downloadrails-ed9c8d4d828fe4e28c1e37ed8921acbee54450f2.tar.gz
rails-ed9c8d4d828fe4e28c1e37ed8921acbee54450f2.tar.bz2
rails-ed9c8d4d828fe4e28c1e37ed8921acbee54450f2.zip
renamed strategy to formatter
Diffstat (limited to 'lib/active_relation/primitives')
-rw-r--r--lib/active_relation/primitives/attribute.rb8
-rw-r--r--lib/active_relation/primitives/expression.rb2
-rw-r--r--lib/active_relation/primitives/value.rb4
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/active_relation/primitives/attribute.rb b/lib/active_relation/primitives/attribute.rb
index f2c484cc59..fc857347fc 100644
--- a/lib/active_relation/primitives/attribute.rb
+++ b/lib/active_relation/primitives/attribute.rb
@@ -111,16 +111,16 @@ module ActiveRelation
end
include Expressions
- def to_sql(strategy = Sql::WhereCondition.new(engine))
- strategy.attribute prefix, name, self.alias
+ def to_sql(formatter = Sql::WhereCondition.new(engine))
+ formatter.attribute prefix, name, self.alias
end
def format(object)
- object.to_sql(strategy)
+ object.to_sql(formatter)
end
private
- def strategy
+ def formatter
Sql::Attribute.new(self)
end
diff --git a/lib/active_relation/primitives/expression.rb b/lib/active_relation/primitives/expression.rb
index 11aa558977..2df2888ba0 100644
--- a/lib/active_relation/primitives/expression.rb
+++ b/lib/active_relation/primitives/expression.rb
@@ -25,7 +25,7 @@ module ActiveRelation
end
include Transformations
- def to_sql(strategy = nil)
+ def to_sql(formatter = nil)
"#{function_sql}(#{attribute.to_sql})" + (@alias ? " AS #{quote_column_name(@alias)}" : '')
end
diff --git a/lib/active_relation/primitives/value.rb b/lib/active_relation/primitives/value.rb
index 096c876ecd..131610f2e9 100644
--- a/lib/active_relation/primitives/value.rb
+++ b/lib/active_relation/primitives/value.rb
@@ -6,8 +6,8 @@ module ActiveRelation
@value, @relation = value, relation
end
- def to_sql(strategy = Sql::WhereCondition.new(relation.engine))
- strategy.value value
+ def to_sql(formatter = Sql::WhereCondition.new(relation.engine))
+ formatter.value value
end
def format(object)