Remove dead code

This commit is contained in:
Artur Beljajev 2019-12-18 05:40:53 +02:00 committed by Alex Sherman
parent 915ebbff08
commit fd95d76c49
3 changed files with 1 additions and 5 deletions

View file

@ -21,8 +21,6 @@ class Contact < ApplicationRecord
alias_attribute :kind, :ident_type alias_attribute :kind, :ident_type
alias_attribute :copy_from_id, :original_id # Old attribute name; for PaperTrail alias_attribute :copy_from_id, :original_id # Old attribute name; for PaperTrail
accepts_nested_attributes_for :legal_documents
scope :email_verification_failed, lambda { scope :email_verification_failed, lambda {
joins('LEFT JOIN email_address_verifications emv ON contacts.email = emv.email') joins('LEFT JOIN email_address_verifications emv ON contacts.email = emv.email')
.where('success = false and verified_at IS NOT NULL') .where('success = false and verified_at IS NOT NULL')

View file

@ -55,7 +55,6 @@ class Domain < ApplicationRecord
accepts_nested_attributes_for :dnskeys, allow_destroy: true accepts_nested_attributes_for :dnskeys, allow_destroy: true
has_many :legal_documents, as: :documentable has_many :legal_documents, as: :documentable
accepts_nested_attributes_for :legal_documents, reject_if: proc { |attrs| attrs[:body].blank? }
has_many :registrant_verifications, dependent: :destroy has_many :registrant_verifications, dependent: :destroy
after_initialize do after_initialize do

View file

@ -1,5 +1,4 @@
class LegalDocument < ApplicationRecord class LegalDocument < ApplicationRecord
cattr_accessor :explicitly_write_file
include EppErrors include EppErrors
MIN_BODY_SIZE = (1.37 * 3.kilobytes).ceil MIN_BODY_SIZE = (1.37 * 3.kilobytes).ceil
@ -44,7 +43,7 @@ class LegalDocument < ApplicationRecord
break unless File.file?(path) break unless File.file?(path)
end end
File.open(path, 'wb') { |f| f.write(binary) } if !Rails.env.test? || self.class.explicitly_write_file File.open(path, 'wb') { |f| f.write(binary) } if !Rails.env.test?
self.path = path self.path = path
self.checksum = digest self.checksum = digest
end end