activerecord-postgresql-extensions icon indicating copy to clipboard operation
activerecord-postgresql-extensions copied to clipboard

Incompatibility with Rails 4.rc1

Open chatgris opened this issue 12 years ago • 7 comments

Hello,

I ran across an issue while upgrading to rails 4.rc1.

wrong number of arguments (1 for 4)
/home/chatgris/.gem/ruby/2.0.0/gems/activerecord-4.0.0.rc1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:54:in `initialize'
/home/chatgris/dev/oss/activerecord-postgresql-extensions/lib/active_record/postgresql_extensions/tables.rb:180:in `initialize'
/home/chatgris/dev/oss/activerecord-postgresql-extensions/lib/active_record/postgresql_extensions/tables.rb:109:in `new'
/home/chatgris/dev/oss/activerecord-postgresql-extensions/lib/active_record/postgresql_extensions/tables.rb:109:in `create_table'
/home/chatgris/.gem/ruby/2.0.0/gems/activerecord-4.0.0.rc1/lib/active_record/schema_migration.rb:21:in `create_table'
/home/chatgris/.gem/ruby/2.0.0/gems/activerecord-4.0.0.rc1/lib/active_record/migration.rb:857:in `initialize'
/home/chatgris/.gem/ruby/2.0.0/gems/activerecord-4.0.0.rc1/lib/active_record/migration.rb:747:in `new'
/home/chatgris/.gem/ruby/2.0.0/gems/activerecord-4.0.0.rc1/lib/active_record/migration.rb:747:in `up'
/home/chatgris/.gem/ruby/2.0.0/gems/activerecord-4.0.0.rc1/lib/active_record/migration.rb:725:in `migrate'
/home/chatgris/.gem/ruby/2.0.0/gems/activerecord-4.0.0.rc1/lib/active_record/railties/databases.rake:42:in `block (2 levels) in <top (required)>'
/home/chatgris/.gem/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/home/chatgris/.gem/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/home/chatgris/.gem/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/home/chatgris/.gem/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/home/chatgris/.gem/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/home/chatgris/.gem/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/home/chatgris/.gem/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/home/chatgris/.gem/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/home/chatgris/.gem/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/home/chatgris/.gem/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/home/chatgris/.gem/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/home/chatgris/.gem/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/home/chatgris/.gem/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/home/chatgris/.gem/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/home/chatgris/.gem/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/home/chatgris/.gem/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
Tasks: TOP => db:migrate

I dug a little, and this seems to be related to some refactoring into ActiveRecord, TableDefinition no longer receive the connector object.

I tried to modify the initialize method to match the one from AR, but there are some other breaking changes.

Check out https://github.com/rails/rails/commit/14d7dc0811fc946ffb63ceed7e0389ed14b50800 , https://github.com/rails/rails/commit/a80bcc395cd691f5a1ad11af8ad9cff1ab79163f or https://github.com/rails/rails/commit/b8a533d5f16de5c9df59a9275a1f15d49f1b0256 for example.

chatgris avatar May 02 '13 01:05 chatgris

We're planning on a new release once Rails 4 is out. We've just been working out the Rails 4 fixes. There's still so many changes going on with Rails 4 that it's hard to pin down an exact date, but once Rails 4 final comes out and things are stable, we'll be releasing a new gem with all of the fixes in place. I've done a few of the changes already, but need some time to look at the schema creation changes and work them in with our extensions.

dark-panda avatar Jun 03 '13 19:06 dark-panda

:+1:

mhenrixon avatar Nov 28 '13 14:11 mhenrixon

How about it?

jtarchie avatar Jan 15 '14 13:01 jtarchie

:+1:

ukd1 avatar Feb 05 '14 20:02 ukd1

Come on guys, rails 4 has been out for some time... :+1:

mhenrixon avatar Feb 05 '14 20:02 mhenrixon

Could anyone with Rails 4 issues please give the rails-4 branch a test run? We haven't had the time to upgrade our own applications to Rails 4 yet, but I have refactored rails-4 branch that Works For Me(tm) in Rails 3.2 and 4.0.2 as far as the unit tests are concerned. If we get some positive feedback that things are actually running correctly outside of the unit tests then we should be able to do a release. (Our internal migration to Rails 4 has taken a lot longer than expected, so Rails 4 testing has been slow going, and thus we haven't had the time to do a real world test on this gem. :/ )

dark-panda avatar Feb 05 '14 23:02 dark-panda

Tried rails-4 branch in one of my Rails projects. Worked for me on Rails 4.1.4. Features used:

  • :inherits
  • t.unique_constraint
  • :references

mavenik avatar Jul 18 '14 12:07 mavenik