tap/app/models/product.rb
2014-11-10 15:52:54 +01:00

12 lines
222 B
Ruby

class Product < ActiveRecord::Base
after_initialize :init
def init
self.name ||= "FOOBAR"
self.sale_price ||= 0
self.purchase_price ||= 0
self.image_path = "/" #paperclip gem
end
end