diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-07-03 08:32:12 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-07-03 08:32:12 +0000 |
commit | 397c8ee2a9bd3e5a0113b8aaa8ccf6500a70ea77 (patch) | |
tree | e796bf97e31d954599841866fa037712a85e39c8 /activerecord/lib | |
parent | b02776c2321004e1b3855140eb0a6590a634de2d (diff) | |
download | rails-397c8ee2a9bd3e5a0113b8aaa8ccf6500a70ea77.tar.gz rails-397c8ee2a9bd3e5a0113b8aaa8ccf6500a70ea77.tar.bz2 rails-397c8ee2a9bd3e5a0113b8aaa8ccf6500a70ea77.zip |
r1608@asus: jeremy | 2005-07-03 00:13:57 -0700
quoter required for column quoting
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1626 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 69c19cb1fb..e620b662fa 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1384,18 +1384,20 @@ module ActiveRecord #:nodoc: end def quoted_column_names(attributes = attributes_with_quotes) - attributes.keys.collect { |column_name| connection.quote_column_name(column_name) } + attributes.keys.collect do |column_name| + self.class.connection.quote_column_name(column_name) + end end - def quote_columns(column_quoter, hash) - hash.inject({}) do |list, pair| - list[column_quoter.quote_column_name(pair.first)] = pair.last - list + def quote_columns(quoter, hash) + hash.inject({}) do |quoted, (name, value)| + quoted[quoter.quote_column_name(name)] = value + quoted end end - def quoted_comma_pair_list(column_quoter, hash) - comma_pair_list(quote_columns(column_quoter, hash)) + def quoted_comma_pair_list(quoter, hash) + comma_pair_list(quote_columns(quoter, hash)) end def object_from_yaml(string) |