Initial commit
This commit is contained in:
21
app/models/province.rb
Normal file
21
app/models/province.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
class Province < ApplicationRecord
|
||||
has_many :cities
|
||||
|
||||
validates :name, presence: true,
|
||||
length: 1..255,
|
||||
format: {
|
||||
with: /\A[[:word:]\s\-']+\z/,
|
||||
message: 'only allows letters, digits "-", "\'", and space'
|
||||
}
|
||||
end
|
||||
|
||||
# == Schema Information
|
||||
# Schema version: 20210420111532
|
||||
#
|
||||
# Table name: provinces
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# name :string(255)
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
Reference in New Issue
Block a user