mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 08:52:04 +02:00
Refactor registrar address to smaller pieces
This commit is contained in:
parent
107767e241
commit
39ea06ab17
8 changed files with 57 additions and 22 deletions
|
@ -7,7 +7,7 @@ class Registrar < ActiveRecord::Base
|
|||
has_many :messages
|
||||
belongs_to :country_deprecated, foreign_key: :country_id
|
||||
|
||||
validates :name, :reg_no, :address, :country, :email, presence: true
|
||||
validates :name, :reg_no, :country_code, :email, presence: true
|
||||
validates :name, :reg_no, uniqueness: true
|
||||
after_save :touch_domains_version
|
||||
|
||||
|
@ -22,6 +22,10 @@ class Registrar < ActiveRecord::Base
|
|||
)
|
||||
end
|
||||
|
||||
def address
|
||||
[street, city, state, city].reject(&:empty?).compact.join(', ')
|
||||
end
|
||||
|
||||
def to_s
|
||||
name
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue