mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 08:22:05 +02:00
Basic contact model validations
This commit is contained in:
parent
1e2dad06f9
commit
3caac94bfb
3 changed files with 31 additions and 0 deletions
|
@ -4,6 +4,8 @@ class Contact < ActiveRecord::Base
|
|||
|
||||
has_many :addresses
|
||||
|
||||
validates_presence_of :code, :name, :phone, :email, :ident
|
||||
|
||||
validate :ident_must_be_valid
|
||||
validates :phone, format: { with: /\+\d{3}\.\d+/, message: "bad format" }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue