add models for Project, Task, Note, Category
This commit is contained in:
11
app/models/phone_number.rb
Normal file
11
app/models/phone_number.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class PhoneNumber < ApplicationRecord
|
||||
belongs_to :contact
|
||||
enum :type, {
|
||||
mobile: 0,
|
||||
home: 1,
|
||||
work: 2,
|
||||
fax: 3,
|
||||
other: 4
|
||||
}, _prefix: true
|
||||
validates :number, presence: true, format: { with: /\A\+?[0-9\s\-()]+\z/, message: "must be a valid phone number" }
|
||||
end
|
||||
Reference in New Issue
Block a user