app/models/unidom/geo/china/town.rb in unidom-geo-china-0.5 vs app/models/unidom/geo/china/town.rb in unidom-geo-china-0.5.1
- old
+ new
@@ -5,10 +5,11 @@
self.table_name = 'unidom_china_towns'
include Unidom::Common::Concerns::ModelExtension
- validates :name, presence: true, length: { in: 2..self.columns_hash['name'].limit }
+ validates :numeric_code, length: { minimum: self.columns_hash['numeric_code'].limit }, numericality: { only_integer: true, greater_than_or_equal_to: 0 }
+ validates :name, presence: true, length: { in: 2..self.columns_hash['name'].limit }
belongs_to :region, class_name: 'Unidom::Geo::China::Region'
scope :region_is, ->(region) { where region_id: to_id(region) }