On Mar 21, 2007, at 2:53 PM, Brian Gernhardt wrote:

> The error exists because the migration calls save!, which attempts to
> validate, which uses the class_name column which is created in
> migration 11 (app/models/page.rb:199).  I don't know an easy way to
> fix that.  It works on an empty database because there are no pages
> to call save on.  If I can get it to work, I'll let the list know.

Horrible hack follows.  But it works.

Index: 010_merge_behaviors_and_pages.rb
===================================================================
--- 010_merge_behaviors_and_pages.rb    (revision 355)
+++ 010_merge_behaviors_and_pages.rb    (working copy)
@@ -7,6 +7,7 @@

    def self.up
      announce "converting behavior names to class names"
+    add_column :pages, :class_name, :string
      Page.find(:all).each do |page|
        unless page.behavior_id.blank?
          page.behavior_id = page_name(page.behavior_id)
@@ -14,6 +15,7 @@
        end
      end
      rename_column :pages, :behavior_id, :type
+    remove_column :pages, :class_name
    end
    def self.down

_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to