Sha256: f316c3e998a1290fba2cefcd0457f9ac134d27732d4862e7878fa0e80abbbf1b

Contents?: true

Size: 814 Bytes

Versions: 1

Compression:

Stored size: 814 Bytes

Contents

##
# Product 是产品。

class Unidom::Product::Product < Unidom::Product::ApplicationRecord

  self.table_name = 'unidom_products'

  include Unidom::Common::Concerns::ModelExtension
  include Unidom::Product::Concerns::AsSourceProduct
  include Unidom::Product::Concerns::AsTargetProduct
  include ProgneTapera::EnumCode

  validates :name,             presence: true, length: { in: 2..self.columns_hash['name'].limit             }
  validates :abbreviation,     presence: true, length: { in: 1..self.columns_hash['abbreviation'].limit     }
  validates :measurement_unit, presence: true, length: { in: 1..self.columns_hash['measurement_unit'].limit }
  validates :packing_norm,     presence: true, length: { in: 1..self.columns_hash['packing_norm'].limit     }

  code :formset, Unidom::Product::Formset

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
unidom-product-1.6.1 app/models/unidom/product/product.rb