shotengai_snapshots.rb 1.33 KB
Newer Older
ivan Lan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
# == Schema Information
#
# Table name: shotengai_snapshots
#
#  id                  :integer          not null, primary key
#  original_price      :decimal(9, 2)
#  price               :decimal(9, 2)
#  revised_amount      :decimal(9, 2)
#  count               :integer
#  spec                :json
#  banners             :json
#  cover_image         :string(255)
#  detail              :json
#  type                :string(255)
#  meta                :json
#  shotengai_series_id :integer
#  shotengai_order_id  :integer
#  created_at          :datetime         not null
#  updated_at          :datetime         not null
#
# Indexes
#
#  index_shotengai_snapshots_on_shotengai_order_id   (shotengai_order_id)
#  index_shotengai_snapshots_on_shotengai_series_id  (shotengai_series_id)
#  index_shotengai_snapshots_on_type                 (type)
#

FactoryGirl.define do

30
  factory :product_snapshot, class: '<%= "#{@product}Snapshot" %>' do
ivan Lan committed
31 32 33 34 35 36 37 38 39
    original_price 100
    price 80
    count 2
    spec {
      {
        "颜色" => "红色",
        "大小" => "S",
      }
    }
ivan Lan committed
40
    banners { ['image 1', 'image 2'] }
ivan Lan committed
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
    cover_image 'cover_image 1'
    detail {
      {
        "使用说明" => "xxxxxxxx...",
        "产品参数" => "参数 参数..."
      }
    }

    meta {
      {
        "meta1" => "111",
        "meta2" => "222",
      }
    }
  end
end