I did a simple migration...
class AddAdminDesignationToUsers < ActiveRecord::Migration
add_column :users, :is_admin, :boolean
remove_column :users, :is_admin
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
Any ideas why? I've restarted the server (mogrel), and everything else I
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?