Sha256: 6335bdca5794529a9145408cfc0ee8602c516b694e080a3aeba0a4dc954d85e7

Contents?: true

Size: 387 Bytes

Versions: 12

Compression:

Stored size: 387 Bytes

Contents

module MuckCommerce
  module OrderMethods
  
    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
  
    def dollar_amount
      self.amount * 0.01
    end
  
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
muck-commerce-3.0.1 lib/muck-commerce/share/order_methods.rb
muck-commerce-0.2.8 lib/muck_commerce/order_methods.rb
muck-commerce-0.2.7 lib/muck_commerce/order_methods.rb
muck-commerce-0.2.6 lib/muck_commerce/order_methods.rb
muck-commerce-0.2.5 lib/muck_commerce/order_methods.rb
muck-commerce-0.2.4 lib/muck_commerce/order_methods.rb
muck-commerce-0.2.3 lib/muck_commerce/order_methods.rb
muck-commerce-0.2.2 lib/muck_commerce/order_methods.rb
muck-commerce-0.2.1 lib/muck_commerce/order_methods.rb
muck-commerce-0.2.0 lib/muck_commerce/order_methods.rb
muck-commerce-0.1.9 lib/muck_commerce/order_methods.rb
muck-commerce-0.1.8 lib/muck_commerce/order_methods.rb