Sha256: c8fae3766f66cf07bdddb222086848a591946f5af444ad064af3bc3033e1ba6a

Contents?: true

Size: 822 Bytes

Versions: 88

Compression:

Stored size: 822 Bytes

Contents

class CoTailors::OrderItem
  include Mongoid::Document
  include Mongoid::Timestamps

  belongs_to :order, :class_name => 'CoTailors::Order'

  KIND_SHIRT = 'const-kind-shirt'
  KIND_PANTS = 'const-kind-pants'
  KIND_SUIT  = 'const-kind-suits'
  KINDS      = %w{ const-kind-shirt const-kind-pants const-kind-suits }
  field :kind, :type => String
  validates :kind, :presence => true

  FABRICS = [ :white, :black, :light_blue, :dark_blue, :dark_green, :pink, :gray ]
  field :fabric, :type => String
  validates :fabric, :presence => true

  has_one :measurement, :class_name => 'CoTailors::ProfileMeasurement'
  validates :measurement, :presence => true

  field :quantity, :type => Integer
  validates :quantity, :presence => true

  field :cost, :type => Integer # pennies!
  validates :cost, :presence => true

end

Version data entries

88 entries across 88 versions & 1 rubygems

Version Path
ish_models-0.0.33.163 lib/co_tailors/order_item.rb
ish_models-0.0.33.162 lib/co_tailors/order_item.rb
ish_models-0.0.33.161 lib/co_tailors/order_item.rb
ish_models-0.0.33.160 lib/co_tailors/order_item.rb
ish_models-0.0.33.159 lib/co_tailors/order_item.rb
ish_models-0.0.33.158 lib/co_tailors/order_item.rb
ish_models-0.0.33.157 lib/co_tailors/order_item.rb
ish_models-0.0.33.156 lib/co_tailors/order_item.rb
ish_models-0.0.33.154 lib/co_tailors/order_item.rb
ish_models-0.0.33.153 lib/co_tailors/order_item.rb
ish_models-0.0.33.152 lib/co_tailors/order_item.rb
ish_models-0.0.33.151 lib/co_tailors/order_item.rb
ish_models-0.0.33.150 lib/co_tailors/order_item.rb
ish_models-0.0.33.149 lib/co_tailors/order_item.rb
ish_models-0.0.33.148 lib/co_tailors/order_item.rb
ish_models-0.0.33.147 lib/co_tailors/order_item.rb
ish_models-0.0.33.146 lib/co_tailors/order_item.rb
ish_models-0.0.33.145 lib/co_tailors/order_item.rb
ish_models-0.0.33.144 lib/co_tailors/order_item.rb
ish_models-0.0.33.143 lib/co_tailors/order_item.rb