Sha256: af22bce0f0f2e74c4b706727485f78a75da9ad4297eb389f105c6cb0eb1e575a
Contents?: true
Size: 624 Bytes
Versions: 66
Compression:
Stored size: 624 Bytes
Contents
require_relative 'order_item' class CoTailors::Order include Mongoid::Document include Mongoid::Timestamps belongs_to :profile, :class_name => '::IshModels::UserProfile' has_many :items, :class_name => '::CoTailors::OrderItem' field :submitted_at, :type => Time MEASUREMENT_PARAMS = [ :neck_around, :chest_around, :waist_around, :sleeve_length, :shoulder_width, :shirt_length, :bicep_around ] def grand_total tax = 0.05 shipping = 0 # 1200 subtotal = items.all.map { |i| i.cost }.reduce( :+ ) subtotal = subtotal * (tax + 1) subtotal += shipping return subtotal.to_i end end
Version data entries
66 entries across 66 versions & 1 rubygems