Topic: Accessing a column value after appending it through migration

After I created a model named 'user' I edited the migration to have all the columns that I needed.  After I ran the migration, I thought of one more column I needed.  So I generated a new migration, edited it, and ran it, and the column was inserted fine.

But now, when I try to access that information, activerecord returns nil, or null (is it an object?) every time, as if it didn't see that I added the column.  I thought that my app would be aware that I added that column if I ran a migration (or even if I were to add it by hand). 

Is there something more I need to do to be able to access this column from the database? (I have defined attr_accessor :column, and even tried writing a custom accessor method).

Re: Accessing a column value after appending it through migration

Restarting the server fixes bugs like these. smile

http://danielfischer.com - Personal Web-Technology-Blog, Los Angeles.

Re: Accessing a column value after appending it through migration

Defining attr_accessor :column, might be your problem.  You don't need to do this.  This creates a new instance variable that is probably overridding the one defined by active record from the database.

Remove that and see what happens.

Re: Accessing a column value after appending it through migration

thabenksta, you were right.  I probably never would have thought of that, even thought it's one of those 'oh duh' kind of problems.  thanks for the help