vendredi 13 mars 2015

Composite field in rails model

I have this model in Rails:



class PaymentsDcument < ActiveRecord::Base
attr_accessible :date, :domain, :id, :total, :paid, :paid_left, :percentage
end


and I want to add the field payment_total = total*percentage without creating the field in the database.


Aucun commentaire:

Enregistrer un commentaire