Merge branch 'master' of github.com:domify/registry

Conflicts:
	app/assets/stylesheets/shared/general.sass
This commit is contained in:
Martin Lensment 2015-04-21 13:23:50 +03:00
commit dbbc6b3bff
58 changed files with 552 additions and 322 deletions

View file

@ -1,14 +1,10 @@
class AdminUser < User
# TODO: Foreign user will get email with activation link,email,temp-password.
# After activisation, system should require to change temp password.
# TODO: Estonian id validation
validates :username, :password, :country_code, presence: true
validates :username, :password, :country_code, :roles, presence: true
validates :identity_code, uniqueness: true, allow_blank: true
validates :identity_code, presence: true, if: -> { country_code == 'EE' }
validates :email, presence: true, if: -> { country_code != 'EE' }
validates :email, presence: true
validate :validate_identity_code
validate :validate_identity_code, if: -> { country_code == 'EE' }
belongs_to :country_deprecated, foreign_key: :country_id
ROLES = %w(user customer_service admin)

View file

@ -0,0 +1,9 @@
module DisableHtml5Validation
extend ActiveSupport::Concern
class_methods do
def auto_html5_validation
false
end
end
end

View file

@ -2,6 +2,7 @@ class Deposit
include ActiveModel::Validations
include ActiveModel::Conversion
extend ActiveModel::Naming
include DisableHtml5Validation
attr_accessor :amount, :description, :registrar

View file

@ -1,6 +1,7 @@
module Depp
class Contact
include ActiveModel::Model
include DisableHtml5Validation
attr_accessor :id, :name, :email, :phone, :org_name,
:ident, :ident_type, :ident_country_code,

View file

@ -2,6 +2,7 @@ module Depp
class Domain
include ActiveModel::Conversion
extend ActiveModel::Naming
include DisableHtml5Validation
attr_accessor :name, :current_user, :epp_xml

View file

@ -1,5 +1,6 @@
module Depp
class Keyrelay
include DisableHtml5Validation
attr_accessor :current_user, :epp_xml
def initialize(args = {})

View file

@ -3,6 +3,7 @@ module Depp
include ActiveModel::Validations
include ActiveModel::Conversion
extend ActiveModel::Naming
include DisableHtml5Validation
attr_accessor :tag, :password, :pki

View file

@ -53,7 +53,7 @@ class DomainTransfer < ActiveRecord::Base
def notify_losing_registrar
transfer_from.messages.create!(
body: I18n.t('domain_transfer_was_approved', contacts: domain.contacts.pluck(:code)),
body: I18n.t('domain_transfer_was_approved', contacts: domain.contacts.pluck(:code).sort),
attached_obj_id: id,
attached_obj_type: self.class.to_s
)

View file

@ -14,7 +14,7 @@ class Registrar < ActiveRecord::Base
validates :name, :reg_no, :reference_no, uniqueness: true
validate :set_code, if: :new_record?
before_create :generate_iso_11649_reference_no
before_validation :generate_iso_11649_reference_no
def generate_iso_11649_reference_no
return if reference_no.present?