Hi,

I'm still having problem with running migrations. I've tried the code below:


class FormStatusField < V 1.1

def self.up

add_column(Reviewform.table_name, :status, :string)

Reviewform.reset_column_information

end

def self.down

remove_column(Reviewform.table_name, :status)

end

end


And with ActiveRecord 4.0.4 this gives me the error below:


 NoMethodError at /form/new


   undefined method `status' for
   #<Review::Models::Reviewform:0x00000002ca27c0>

Ruby

        

|/home/sebastjan/.rvm/gems/ruby-2.1.5/gems/activemodel-4.0.4/lib/active_model/attribute_methods.rb|: in|method_missing|, line 439

Web

        

|GET localhost/form/new|


The column is not added which I confirm by browsing the sql table.


I've tried the later AR version, namely 4.2.0 and I can't even run the initial migration. I guess this is related to this issue https://github.com/camping/camping/issues/77.

As this problem in general is probably related to AR, can someone confirm for which AR version migrations run fine.

This is crucial to my app as I need to deploy it productively this month and currently I can bypass this issue only by switching databases and refactor the initial migration.


Additional note: this code from the book also didn't work

|  ||class
AddTagColumn < V 1.1|

|
   ||def
self.change|

|
    ||add_column
Page.table_name, :tag, :string|

|
    ||Page.reset_column_information|

|
   ||end|

|
 ||end|

regards,

seba

_______________________________________________
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Reply via email to