Model field accessor missing? Driving me insane.

I did a simple migration...

class AddAdminDesignationToUsers < ActiveRecord::Migration
def self.up
   add_column :users, :is_admin, :boolean
end

def self.down
   remove_column :users, :is_admin
end
end

Now, if I go into the rails console, I can load a user from the DB and I
get correct results... u.is_admin? => false (or whatever).

But if I use 'is_admin?' or 'is_admin' in a view or the controller
itself, I get an error: 'undefined method `is_admin?' for
#<User:0x47750ac>'

Any ideas why? I've restarted the server (mogrel), and everything else I
could
think of. Why would that work in the rails console (which uses the same
environment, etc) but not in the app itself?

Perhaps you ran the migration and console in development mode, but your app is running in production mode so the migration never made it into the right database?

?

unsubscribe