mirror of
https://github.com/internetee/registry.git
synced 2025-07-02 17:23:34 +02:00
TEMP
This commit is contained in:
parent
79ac8db0eb
commit
5da7019bd4
7 changed files with 3 additions and 70 deletions
|
@ -311,8 +311,8 @@ class Contact < ActiveRecord::Base
|
|||
def status_notes_array=(notes)
|
||||
self.status_notes = {}
|
||||
notes ||= []
|
||||
statuses.each_with_index do |status,i|
|
||||
self.status_notes[status] = notes[i]
|
||||
statuses.each_with_index do |status, i|
|
||||
status_notes[status] = notes[i]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -78,7 +78,6 @@ class Domain < ActiveRecord::Base
|
|||
end
|
||||
after_save :update_whois_record
|
||||
|
||||
|
||||
after_create :update_reserved_domains
|
||||
def update_reserved_domains
|
||||
return unless in_reserved_list?
|
||||
|
|
|
@ -11,7 +11,7 @@ class Epp::Domain < Domain
|
|||
|
||||
before_validation :validate_contacts
|
||||
def validate_contacts
|
||||
return if contacts.map {|c| c.valid? }.all?
|
||||
return if contacts.map(&:valid?).all?
|
||||
add_epp_error('2304', nil, nil, I18n.t(:object_status_prohibits_operation))
|
||||
false
|
||||
end
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
# Log all active model user errors
|
||||
module ActiveModel
|
||||
class Errors
|
||||
def add(attribute, message = :invalid, options = {})
|
||||
message = normalize_message(attribute, message, options)
|
||||
if exception = options[:strict]
|
||||
exception = ActiveModel::StrictValidationFailed if exception == true
|
||||
raise exception, full_message(attribute, message)
|
||||
end
|
||||
|
||||
# CUSTOM logging
|
||||
Rails.logger.info "USER MSG: ACTIVEMODEL: #{@base.try(:class)} [#{attribute}] #{message}" if message.present?
|
||||
# END of CUSTOM logging
|
||||
|
||||
self[attribute] << message
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,7 +0,0 @@
|
|||
# Log all user issues raised by active record
|
||||
class ActiveRecord::Base
|
||||
after_validation do |m|
|
||||
Rails.logger.info "USER MSG: ACTIVERECORD: #{m.class} ##{m.id} #{m.errors.full_messages} #{m.errors['epp_errors']}" if m.errors.present?
|
||||
true
|
||||
end
|
||||
end
|
|
@ -1,27 +0,0 @@
|
|||
# Log all flash messages
|
||||
module ActionDispatch
|
||||
class Flash
|
||||
def call(env)
|
||||
@app.call(env)
|
||||
ensure
|
||||
session = Request::Session.find(env) || {}
|
||||
flash_hash = env[KEY]
|
||||
|
||||
if flash_hash && (flash_hash.present? || session.key?('flash'))
|
||||
session["flash"] = flash_hash.to_session_value
|
||||
|
||||
# EIS custom logging
|
||||
Rails.logger.info "USER MSG: FLASH: #{session['flash']['flashes'].inspect}" if session['flash']
|
||||
# END OF EIS custom logging
|
||||
|
||||
env[KEY] = flash_hash.dup
|
||||
end
|
||||
|
||||
if (!session.respond_to?(:loaded?) || session.loaded?) && # (reset_session uses {}, which doesn't implement #loaded?)
|
||||
session.key?('flash') && session['flash'].nil?
|
||||
session.delete('flash')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
# EIS custom rack hack in order to enable test external interfaces EPP/REPP inside webserver network
|
||||
# rubocop:disable Metrics/LineLength
|
||||
module Rack
|
||||
class Request
|
||||
def trusted_proxy?(ip)
|
||||
if ENV['eis_trusted_proxies']
|
||||
ENV['eis_trusted_proxies'].split(',').map(&:strip).include?(ip)
|
||||
else
|
||||
ip =~ /\A127\.0\.0\.1\Z|\A(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\.|\A::1\Z|\Afd[0-9a-f]{2}:.+|\Alocalhost\Z|\Aunix\Z|\Aunix:/i
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
# rubocop:enable Metrics/LineLength
|
Loading…
Add table
Add a link
Reference in a new issue