Fishing for +1's on 10314--db:migrate honors primary_key_prefix_type

Currently, db:migrate ignores
config.active_record.primary_key_prefix_type declarations. The fix
was much simpler than I expected.

http://dev.rubyonrails.org/ticket/10314

In upgrading an app from 1.2.4 to 2.0.2 I’ve run in to the following problem:

NoMethodError in FormsController#forms_field_update

You have a nil object when you didn’t expect it!

You might have expected an instance of ActiveRecord::Base.

The error occurred while evaluating nil.[]

vendor/rails/actionpack/lib/action_controller/url_rewriter.rb:95:in `rewrite_url’

vendor/rails/actionpack/lib/action_controller/url_rewriter.rb:81:in `rewrite’

vendor/rails/actionpack/lib/action_controller/base.rb:616:in `url_for’

vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb:76:in `send’

vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb:76:in `url_for’

vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb:461:in `remote_function’

vendor/rails/actionpack/lib/action_view/helpers/scriptaculous_helper.rb:144:in `sortable_element_js’

vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb:920:in `send’

vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb:920:in `sortable’

app/controllers/forms_controller.rb:345:in `__instance_exec0’

app/controllers/forms_controller.rb:341:in `update’

/usr/local/bin/mongrel_rails:16:in `load’

/usr/local/bin/mongrel_rails:16

I was previously calling sortable_element ‘div_id’, :url => {:action => ‘do_sort’ }

and sortable(‘div_id’) in the update, which worked. Now it seems I have to call sortable(‘div_id’, :url => {:action => ‘do_sort’ } or else I get the above error. Somehow url_for is getting passed nil options. The rails tests don’t test for my usage, is this not valid behavior anymore? It used to work fine.

If this is a valid change, perhaps documentation of this or a better error would be helpful.

Steven Soroka