Class Product
In: app/models/product.rb
Parent: ActiveRecord::Base

Methods

Public Class methods

[Source]

    # File app/models/product.rb, line 11
11:   def self.find_products_for_sale
12:     find(:all, :order => "title")
13:   end

Protected Instance methods

[Source]

    # File app/models/product.rb, line 16
16:   def validate
17:     errors.add(:price, "powinna wynosić przynajmniej 0.01" ) if price.nil? || price < 0.01
18:   end

[Validate]