This project is archived and is in readonly mode.
Failing test with Postgresql 8.4.3 and pg 0.9.0
Reported by Santiago Pastorino | April 7th, 2010 @ 11:47 PM | in 3.0.2
I'm getting the following error on schema_test_postgresql.rb
when the setup code do
@connection = ActiveRecord::Base.connection
@connection.execute "CREATE SCHEMA #{SCHEMA_NAME} CREATE TABLE #{TABLE_NAME} (#{COLUMNS.join(',')})"
@connection.execute "CREATE TABLE #{SCHEMA_NAME}.\"#{TABLE_NAME}.table\" (#{COLUMNS.join(',')})"
@connection.execute "CREATE TABLE #{SCHEMA_NAME}.\"#{CAPITALIZED_TABLE_NAME}\" (#{COLUMNS.join(',')})"
@connection.tables doesn't have things table ...
santiago@debian:~/Documentos/WyeWorks/Proys/rails$ cd activerecord/test/
santiago@debian:~/Documentos/WyeWorks/Proys/rails/activerecord/test$ ruby -I connections/native_postgresql/ cases/schema_test_postgresql.rb -n test_classes_with_qualified_schema_name
Using native PostgreSQL
Loaded suite cases/schema_test_postgresql
Started
E
Finished in 0.090174 seconds.
1) Error:
test_classes_with_qualified_schema_name(SchemaTest):
NoMethodError: undefined method `name' for #
/home/santiago/Documentos/WyeWorks/Proys/rails/vendor/bundler/gems/arel-8151ac946644aab31601d7c0ed944eb9d7ea1e6b-master/lib/arel/engines/sql/relations/compiler.rb:41:in `insert_sql'
/home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:848:in `sort_by'
/home/santiago/Documentos/WyeWorks/Proys/rails/vendor/bundler/gems/arel-8151ac946644aab31601d7c0ed944eb9d7ea1e6b-master/lib/arel/engines/sql/relations/compiler.rb:40:in `each'
/home/santiago/Documentos/WyeWorks/Proys/rails/vendor/bundler/gems/arel-8151ac946644aab31601d7c0ed944eb9d7ea1e6b-master/lib/arel/engines/sql/relations/compiler.rb:40:in `sort_by'
/home/santiago/Documentos/WyeWorks/Proys/rails/vendor/bundler/gems/arel-8151ac946644aab31601d7c0ed944eb9d7ea1e6b-master/lib/arel/engines/sql/relations/compiler.rb:40:in `insert_sql'
/home/santiago/Documentos/WyeWorks/Proys/rails/vendor/bundler/gems/arel-8151ac946644aab31601d7c0ed944eb9d7ea1e6b-master/lib/arel/engines/sql/relations/writes.rb:10:in `to_sql'
/home/santiago/Documentos/WyeWorks/Proys/rails/vendor/bundler/gems/arel-8151ac946644aab31601d7c0ed944eb9d7ea1e6b-master/lib/arel/engines/sql/engine.rb:36:in `create'
/home/santiago/Documentos/WyeWorks/Proys/rails/vendor/bundler/gems/arel-8151ac946644aab31601d7c0ed944eb9d7ea1e6b-master/lib/arel/algebra/relations/writes.rb:20:in `call'
/home/santiago/Documentos/WyeWorks/Proys/rails/vendor/bundler/gems/arel-8151ac946644aab31601d7c0ed944eb9d7ea1e6b-master/lib/arel/session.rb:32:in `create'
/home/santiago/Documentos/WyeWorks/Proys/rails/vendor/bundler/gems/arel-8151ac946644aab31601d7c0ed944eb9d7ea1e6b-master/lib/arel/algebra/relations/relation.rb:64:in `insert'
/home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/relation.rb:18:in `__send__'
/home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/relation.rb:18:in `insert'
/home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/base.rb:2003:in `create_without_timestamps'
/home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/timestamp.rb:55:in `create_without_callbacks'
/home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/callbacks.rb:278:in `create'
/home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/callbacks.rb:407:in `_run_create_callbacks'
/home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/callbacks.rb:277:in `create'
/home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/base.rb:1979:in `create_or_update_without_callbacks'
/home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/callbacks.rb:271:in `create_or_update'
/home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/callbacks.rb:407:in `_run_save_callbacks'
/home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/callbacks.rb:270:in `create_or_update'
/home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/base.rb:1652:in `save_without_validation'
/home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/validations.rb:57:in `save_without_dirty'
/home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/attribute_methods/dirty.rb:21:in `save_without_transactions'
/home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/transactions.rb:229:in `send'
/home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/transactions.rb:229:in `with_transaction_returning_status'
/home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/transactions.rb:182:in `transaction'
/home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'
/home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/transactions.rb:196:in `save'
/home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
/home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/transactions.rb:196:in `save'
/home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/base.rb:461:in `create'
cases/schema_test_postgresql.rb:91:in `test_classes_with_qualified_schema_name'
/home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:64:in `__send__'
/home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:64:in `run'
/home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/callbacks.rb:412:in `_run_setup_callbacks'
/home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `run'
1 tests, 4 assertions, 0 failures, 1 errors
Comments and changes to this ticket
-
Aaron Patterson April 7th, 2010 @ 11:49 PM
- Assigned user set to Aaron Patterson
-
Aaron Patterson April 11th, 2010 @ 10:52 PM
- Tag changed from activerecord, postgresql to activerecord, patch, postgresql
Fixed with attached patch. The "table_exists?" method did not take in to account schemas.
-
Aaron Patterson April 12th, 2010 @ 12:05 AM
- State changed from open to committed
This was fixed here:
http://github.com/rails/rails/commit/ecf039fc05ac32b7a8cbd005dd4723...
-
Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
- Importance changed from to Low
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>