I have added an "account" variable to some Rails application I am running, and examined within the development atmosphere having a mongrel server. Everything labored fine. I set my atmosphere to production and employ our Apache server, and all of a sudden nothing works. After lots of debugging, I have discovered that the account variable is succesfullying being Occur my techniques, but it is not SAVING (that's, once it will get from the method that sets it, it's nil). I'm able to call save or save! as numerous occasions when i want, and it is still not set.

The attribute is obtainable, and I am not seeing any errors within the logs... It is simply not saving.

Any idea what's happening?


Ah, I migrated to dev, although not production. I did not think it may be the migrations, if it were, I reasoned, I would not have the ability to access @video.account, or whatever, because I'd obtain a "method doesn't exist" error (that is things i was getting before I migrated in dev).

A little more details to assist you on why that happened:

Browse the file db/schema.rb - it consists of a Ruby representation of the database, up-to-date on each migration. Models in Rails base their characteristics about this file.

Then when you migrate in development mode, the schema file is up-to-date. Whenever you proceed to production mode, that file is stored, and Rails does not realize that the posts you are attempting to assign don't exist. As a result, the item you update accepts the attribute assignment, transmits the query, and progresses - not realizing the attribute did not really save.

That's my knowledge of it - hope this can help you inside your mission!