diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-01-07 22:32:16 -0800 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-01-07 22:32:16 -0800 |
commit | 5f03d1616cc6f66013fbaae9c92553df74a7aee4 (patch) | |
tree | 6f35b2683c858fb6bb95f7dc895aecf1309f48df /lib/active_relation/extensions | |
parent | 2fa1ff4e63f27d49a529116bb5e9933a0f385c3e (diff) | |
download | rails-5f03d1616cc6f66013fbaae9c92553df74a7aee4.tar.gz rails-5f03d1616cc6f66013fbaae9c92553df74a7aee4.tar.bz2 rails-5f03d1616cc6f66013fbaae9c92553df74a7aee4.zip |
removed sql builder
Diffstat (limited to 'lib/active_relation/extensions')
-rw-r--r-- | lib/active_relation/extensions/hash.rb | 6 | ||||
-rw-r--r-- | lib/active_relation/extensions/object.rb | 10 |
2 files changed, 7 insertions, 9 deletions
diff --git a/lib/active_relation/extensions/hash.rb b/lib/active_relation/extensions/hash.rb index f643ac17ab..d9496df2e9 100644 --- a/lib/active_relation/extensions/hash.rb +++ b/lib/active_relation/extensions/hash.rb @@ -5,9 +5,7 @@ class Hash end end - def to_sql(builder = ValuesBuilder.new) - builder.call do - row *values - end + def to_sql(options = {}) + "(#{values.collect(&:to_sql).join(', ')})" end end
\ No newline at end of file diff --git a/lib/active_relation/extensions/object.rb b/lib/active_relation/extensions/object.rb index c241581f86..79d7613d9a 100644 --- a/lib/active_relation/extensions/object.rb +++ b/lib/active_relation/extensions/object.rb @@ -1,12 +1,12 @@ class Object + include SqlBuilder + def qualify self end - def to_sql(builder = EqualsConditionBuilder.new) - me = self - builder.call do - value me.to_s - end + def to_sql(options = {}) + options.reverse_merge!(:quote => true) + options[:quote] ? quote(self) : self end end
\ No newline at end of file |