diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-18 08:11:15 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-18 08:11:15 +0000 |
commit | c35ad2d508e037ebd522d7a3b0a29fd26c68aece (patch) | |
tree | 12ba7aebd44379a0fbacbd0527c6804d2157deaa /activerecord/lib/active_record | |
parent | 03097d3a6047e269641a14f4c93838598011f0b5 (diff) | |
download | rails-c35ad2d508e037ebd522d7a3b0a29fd26c68aece.tar.gz rails-c35ad2d508e037ebd522d7a3b0a29fd26c68aece.tar.bz2 rails-c35ad2d508e037ebd522d7a3b0a29fd26c68aece.zip |
Fixed PostgreSQL usage of fixtures with regards to public schemas and table names with dots #962 [gnuman1@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1206 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-x | activerecord/lib/active_record/fixtures.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index 50a824987d..ce79efc648 100755 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -188,7 +188,7 @@ class Fixtures < Hash old_logger_level = ActiveRecord::Base.logger.level ActiveRecord::Base.logger.level = Logger::ERROR - object.instance_variable_set "@#{table_name}", fixtures + object.instance_variable_set "@#{table_name.to_s.gsub('.','_')}", fixtures if load_instances fixtures.each do |name, fixture| if model = fixture.find @@ -243,7 +243,7 @@ class Fixtures < Hash pk = eval("#{table_class}::primary_key") if pk == 'id' connection.execute( - "SELECT setval('public.#{table.to_s}_id_seq', (SELECT MAX(id) FROM #{table.to_s}), true)", + "SELECT setval('#{table.to_s}_id_seq', (SELECT MAX(id) FROM #{table.to_s}), true)", 'Setting Sequence' ) end |