[typo] Orphan reference to deleted db column?

joy ride joyride88 at gmail.com
Tue Nov 13 20:08:33 EST 2007


Dear all,

As I couldn't find a bug report method on typosphere.org, here it goes! Did
anyone notice the reference to "notify_user_id" in user.rb and the actual
lack of this column in the notifications table? Or am I missing something?

This is generating an error when you "ActiveScaffold" the user model. I just
commented out the ", :foreign_key => 'notify_user_id'"...

*031_add_notifications_table.rb*

    create_table :notifications, :id => false do |t|
      t.column :notify_user_id, :integer

*056_create_notifications.rb*

  def self.up
    rename_table :notifications, :old_notifications
    create_table :notifications do |t|
      t.column :content_id, :integer
      t.column :user_id, :integer
      t.column :created_at, :datetime
      t.column :updated_at, :datetime
    end

    OldNotification.reset_column_information
    Notification.reset_column_information
    if $schema_generator
      OldNotification.find(:all).each do |on|
        Notification.create!(on.attributes)
      end
    end
    drop_table :old_notifications
  end

*user.rb *

  has_many :notifications, :foreign_key => 'notify_user_id'


Best regards, Ricardo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/typo-list/attachments/20071113/31489fa6/attachment-0001.html 


More information about the Typo-list mailing list