Module: MuckCommerce::OrderMethods
- Defined in:
- lib/muck-commerce/share/order_methods.rb
Instance Method Summary collapse
Instance Method Details
#dollar_amount ⇒ Object
14 15 16 |
# File 'lib/muck-commerce/share/order_methods.rb', line 14 def dollar_amount self.amount * 0.01 end |
#order_number ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/muck-commerce/share/order_methods.rb', line 4 def order_number return self.number if !self.number.nil? record = true while record random = Array.new(10){rand(10)}.join record = Order.find(:first, :conditions => ["number = ?", random]) end self.number = random end |