mirror of
https://github.com/internetee/registry.git
synced 2025-08-02 07:52:04 +02:00
Merge branch 'master' of github.com:domify/registry
Conflicts: app/assets/stylesheets/shared/general.sass
This commit is contained in:
commit
dbbc6b3bff
58 changed files with 552 additions and 322 deletions
|
@ -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)
|
||||
|
|
9
app/models/concerns/disable_html5_validation.rb
Normal file
9
app/models/concerns/disable_html5_validation.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
module DisableHtml5Validation
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
class_methods do
|
||||
def auto_html5_validation
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
|
@ -2,6 +2,7 @@ class Deposit
|
|||
include ActiveModel::Validations
|
||||
include ActiveModel::Conversion
|
||||
extend ActiveModel::Naming
|
||||
include DisableHtml5Validation
|
||||
|
||||
attr_accessor :amount, :description, :registrar
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -2,6 +2,7 @@ module Depp
|
|||
class Domain
|
||||
include ActiveModel::Conversion
|
||||
extend ActiveModel::Naming
|
||||
include DisableHtml5Validation
|
||||
|
||||
attr_accessor :name, :current_user, :epp_xml
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
module Depp
|
||||
class Keyrelay
|
||||
include DisableHtml5Validation
|
||||
attr_accessor :current_user, :epp_xml
|
||||
|
||||
def initialize(args = {})
|
||||
|
|
|
@ -3,6 +3,7 @@ module Depp
|
|||
include ActiveModel::Validations
|
||||
include ActiveModel::Conversion
|
||||
extend ActiveModel::Naming
|
||||
include DisableHtml5Validation
|
||||
|
||||
attr_accessor :tag, :password, :pki
|
||||
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
|
|
@ -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?
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue