Is it possible to use the calculate methods (sum, etc.) on attr_accessor
Class Item < ActiveRecord::Base
@total_cost = self.cost_unit * self.amount
calling Item.sum(:total_cost) or Item.sum(‘total_cost’) both return a
unknown column ‘total_cost’ mysql error.
I thought that active record considers attr_accessor objects the same as
columns in the table and all methods available to the model class would
available to the attr_accessor too. Is that not so?