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
30
31
32
33
34
35
36
37
38
39
40
41
# == Schema Information
#
# Table name: shotengai_series
#
# id :integer not null, primary key
# original_price :decimal(9, 2)
# price :decimal(9, 2)
# stock :integer
# spec :json
# type :string(255)
# meta :json
# shotengai_product_id :integer
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_shotengai_series_on_shotengai_product_id (shotengai_product_id)
# index_shotengai_series_on_type (type)
#
FactoryGirl.define do
factory :product_series, class: '<%= "#{@product}Series" %>' do
original_price 100
price 80
stock 10
spec {
{
"颜色" => "红色",
"大小" => "S",
}
}
# type
meta {
{
"series_meta1" => "111",
"series_meta2" => "222",
}
}
end
end