Commit f7b3907e by ivan Lan

Improve annotate in model

parent 6072cd27
...@@ -6,7 +6,7 @@ module Shotengai ...@@ -6,7 +6,7 @@ module Shotengai
# id :integer not null, primary key # id :integer not null, primary key
# title :string(255) # title :string(255)
# status :string(255) # status :string(255)
# spec :json # spec_template :json
# default_series_id :integer # default_series_id :integer
# need_express :boolean # need_express :boolean
# need_time_attr :boolean # need_time_attr :boolean
...@@ -19,7 +19,8 @@ module Shotengai ...@@ -19,7 +19,8 @@ module Shotengai
# manager_type :string(255) # manager_type :string(255)
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# remark :json # remark_template :json
# info_template :json
# #
# Indexes # Indexes
# #
......
...@@ -3,24 +3,26 @@ module Shotengai ...@@ -3,24 +3,26 @@ module Shotengai
# #
# Table name: shotengai_series # Table name: shotengai_series
# #
# id :integer not null, primary key # id :integer not null, primary key
# original_price :decimal(9, 2) # original_price :decimal(9, 2)
# price :decimal(9, 2) # price :decimal(9, 2)
# stock :integer default(-1) # stock :integer default(-1)
# aasm_state :string(255) # spec_value :json
# spec :json # type :string(255)
# type :string(255) # meta :json
# meta :json
# shotengai_product_id :integer # shotengai_product_id :integer
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# aasm_state :string(255)
# remark_value :json
# info_value :json
# #
# Indexes # Indexes
# #
# index_shotengai_series_on_shotengai_product_id (shotengai_product_id) # index_shotengai_series_on_shotengai_product_id (shotengai_product_id)
# index_shotengai_series_on_type (type) # index_shotengai_series_on_type (type)
# #
class Series < Shotengai::Model class Series < Shotengai::Model
self.table_name = 'shotengai_series' self.table_name = 'shotengai_series'
validates_presence_of :spec_value, unless: :spec_template_empty? validates_presence_of :spec_value, unless: :spec_template_empty?
......
...@@ -9,7 +9,7 @@ module Shotengai ...@@ -9,7 +9,7 @@ module Shotengai
# price :decimal(9, 2) # price :decimal(9, 2)
# revised_amount :decimal(9, 2) # revised_amount :decimal(9, 2)
# count :integer # count :integer
# spec :json # spec_value :json
# banners :json # banners :json
# cover_image :string(255) # cover_image :string(255)
# detail :json # detail :json
...@@ -21,6 +21,8 @@ module Shotengai ...@@ -21,6 +21,8 @@ module Shotengai
# updated_at :datetime not null # updated_at :datetime not null
# manager_type :string(255) # manager_type :string(255)
# manager_id :integer # manager_id :integer
# remark_value :json
# info_value :json
# #
# Indexes # Indexes
# #
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment