On Jan 17, 2007, at 1:55 PM, Michael Koziarski wrote:


I don't know if this patch
(http://dev.rubyonrails.org/ticket/7085) is worthy of
inclusion in 1.2, but I thought I'd highlight here just in case it is.

Basically, it fixes the schema dumper and create_table in migrations to
determine the name of the primary key by looking at
ActiveRecord::Base.primary_key_prefix_type rather than just using 'id'. The
patch fixes a significant annoyance for people who use this option.

It seems like the wrong solution,  shouldn't it be like

create_table :enterprisies, :id=>:enterprisey_id do |t|

?

--
Cheers

Koz


I understand why that approach makes sense, but this does feel like a bug for those of us who use this type of naming convention. For example, with the current SchemaDumper, here's some sample output:

  create_table "track", :id => false, :force => true do |t|
    t.column "track_id", :integer, :null => false
    t.column "name", :string
  end

Notice that the primary key gets clobbered, which causes all kinds of fun when the schema is created from schema.rb. With my patch to both SchemaDumper and SchemaStatements, it just works.

--
Building an e-commerce site with Rails?
http://www.agilewebdevelopment.com/rails-ecommerce

Meet up at RailsConf:
http://railsconf2007.conferencemeetup.com/



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to