diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-03-16 15:41:27 -0700 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-03-16 15:41:27 -0700 |
commit | ed9c8d4d828fe4e28c1e37ed8921acbee54450f2 (patch) | |
tree | f650c5b558a21683e55169fbb1defe614733f725 /lib/active_relation/extensions | |
parent | 1a6a3a1c6aa2f75333edef9100951407c4f76f1f (diff) | |
download | rails-ed9c8d4d828fe4e28c1e37ed8921acbee54450f2.tar.gz rails-ed9c8d4d828fe4e28c1e37ed8921acbee54450f2.tar.bz2 rails-ed9c8d4d828fe4e28c1e37ed8921acbee54450f2.zip |
renamed strategy to formatter
Diffstat (limited to 'lib/active_relation/extensions')
-rw-r--r-- | lib/active_relation/extensions/array.rb | 4 | ||||
-rw-r--r-- | lib/active_relation/extensions/hash.rb | 2 | ||||
-rw-r--r-- | lib/active_relation/extensions/object.rb | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/active_relation/extensions/array.rb b/lib/active_relation/extensions/array.rb index 3b4246fb1c..5e2981a4c5 100644 --- a/lib/active_relation/extensions/array.rb +++ b/lib/active_relation/extensions/array.rb @@ -3,7 +3,7 @@ class Array Hash[*flatten] end - def to_sql(strategy = Sql::SelectExpression.new) - strategy.array self + def to_sql(formatter = Sql::SelectExpression.new) + formatter.array self end end
\ No newline at end of file diff --git a/lib/active_relation/extensions/hash.rb b/lib/active_relation/extensions/hash.rb index ae3e48146f..133eab1026 100644 --- a/lib/active_relation/extensions/hash.rb +++ b/lib/active_relation/extensions/hash.rb @@ -9,7 +9,7 @@ class Hash end end - def to_sql(strategy = nil) + def to_sql(formatter = nil) '(' + inject([]) do |values, (key, value)| values << key.format(value) diff --git a/lib/active_relation/extensions/object.rb b/lib/active_relation/extensions/object.rb index 2682ed99fe..cd51543c91 100644 --- a/lib/active_relation/extensions/object.rb +++ b/lib/active_relation/extensions/object.rb @@ -3,8 +3,8 @@ class Object ActiveRelation::Value.new(self, relation) end - def to_sql(strategy = nil) - strategy.scalar self + def to_sql(formatter = nil) + formatter.scalar self end def metaclass |