class Order < ActiveRecord::Base
attr_accessor :order_total
def order_total
self[:order_total] = self.sale_sum+self.freight_charges
end
end
order = Order.find(1)
order.order_total
#=>ActiveModel::MissingAttributeError (can't write unknown attribute `order_total`):