AR private methods

Hi.

I have an AR model named Order, and a field in the DB named expired. I
dont want this field to be modified from outside the model.

Therefore I have declared a private method expired=(value) in my Order
model.

This works fine in development and production; If I call o.expired =
nil I get a “NoMethodError: Attempt to call private method”, and if I
use o.update_attributes(expired => nil) I get
“ActiveRecord::UnknownAttributeError: unknown attribute: expired”.

However in test environment donot get such exceptions. I can easily
use my private methods in my test environment, which is not what I
expected.

Any ideas?

Jarl