mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 19:20:37 +02:00
Refactor registrars
- Reorganize views - Improve database structure - Use default translations - Combine tests
This commit is contained in:
parent
59e9b16dfa
commit
efb63399b2
27 changed files with 287 additions and 353 deletions
|
@ -13,7 +13,7 @@ class Registrar < ActiveRecord::Base
|
|||
|
||||
delegate :balance, to: :cash_account, allow_nil: true
|
||||
|
||||
validates :name, :reg_no, :country_code, :email, :code, presence: true
|
||||
validates :name, :reg_no, :address_country_code, :email, :code, presence: true
|
||||
validates :name, :code, uniqueness: true
|
||||
validates :accounting_customer_code, presence: true
|
||||
validates :language, presence: true
|
||||
|
@ -73,11 +73,11 @@ class Registrar < ActiveRecord::Base
|
|||
buyer: self,
|
||||
buyer_name: name,
|
||||
buyer_reg_no: reg_no,
|
||||
buyer_country_code: country_code,
|
||||
buyer_state: state,
|
||||
buyer_street: street,
|
||||
buyer_city: city,
|
||||
buyer_zip: zip,
|
||||
buyer_country_code: address_country_code,
|
||||
buyer_state: address_state,
|
||||
buyer_street: address_street,
|
||||
buyer_city: address_city,
|
||||
buyer_zip: address_zip,
|
||||
buyer_phone: phone,
|
||||
buyer_url: website,
|
||||
buyer_email: email,
|
||||
|
@ -104,7 +104,7 @@ class Registrar < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def address
|
||||
[street, city, state, zip].reject(&:blank?).compact.join(', ')
|
||||
[address_street, address_city, address_state, address_zip].reject(&:blank?).compact.join(', ')
|
||||
end
|
||||
|
||||
def to_s
|
||||
|
@ -112,7 +112,7 @@ class Registrar < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def country
|
||||
Country.new(country_code)
|
||||
Country.new(address_country_code)
|
||||
end
|
||||
|
||||
def code=(code)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue