tap/app/models/product.rb
2014-11-10 17:06:50 +01:00

11 lines
224 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