Add contact show

This commit is contained in:
Martin Lensment 2014-09-18 18:01:32 +03:00
parent 1777a0e572
commit 2d2a12b7d0
12 changed files with 131 additions and 6 deletions

View file

@ -26,6 +26,11 @@ class Contact < ActiveRecord::Base
validates :code, uniqueness: { message: :epp_id_taken }
delegate :name, to: :international_address
delegate :country, to: :address, prefix: true
delegate :city, to: :address, prefix: true
delegate :street, to: :address, prefix: true
delegate :zip, to: :address, prefix: true
delegate :org_name, to: :address, prefix: true
IDENT_TYPE_ICO = 'ico'
IDENT_TYPES = [
@ -75,7 +80,7 @@ class Contact < ActiveRecord::Base
# Find a way to use self.domains with contact
def domains_owned
Domain.find_by(owner_contact_id: id)
Domain.where(owner_contact_id: id)
end
def relations_with_domain?

View file

@ -1,2 +1,5 @@
class Country < ActiveRecord::Base
def to_s
name
end
end