Change deprecated usage of strings in if blocks

This commit is contained in:
Alex Sherman 2020-01-29 15:13:48 +05:00
parent af57711dc0
commit 95ad3086b0
4 changed files with 6 additions and 6 deletions

View file

@ -10,7 +10,7 @@ module Epp
before_action :latin_only before_action :latin_only
before_action :validate_against_schema before_action :validate_against_schema
before_action :validate_request before_action :validate_request
before_action :update_epp_session, if: 'signed_in?' before_action :update_epp_session, if: -> { signed_in? }
around_action :wrap_exceptions around_action :wrap_exceptions

View file

@ -23,7 +23,7 @@ class Contact < ApplicationRecord
accepts_nested_attributes_for :legal_documents accepts_nested_attributes_for :legal_documents
validates :name, :email, presence: true validates :name, :email, presence: true
validates :street, :city, :zip, :country_code, presence: true, if: 'self.class.address_processing?' validates :street, :city, :zip, :country_code, presence: true, if: -> { self.class.address_processing? }
validates :phone, presence: true, e164: true, phone: true validates :phone, presence: true, e164: true, phone: true
@ -37,7 +37,7 @@ class Contact < ApplicationRecord
validates_associated :identifier validates_associated :identifier
validate :validate_html validate :validate_html
validate :validate_country_code, if: 'self.class.address_processing?' validate :validate_country_code, if: -> { self.class.address_processing? }
after_initialize do after_initialize do
self.status_notes = {} if status_notes.nil? self.status_notes = {} if status_notes.nil?

View file

@ -21,9 +21,9 @@ class Registrar < ApplicationRecord
validates :reference_no, format: Billing::ReferenceNo::REGEXP validates :reference_no, format: Billing::ReferenceNo::REGEXP
validate :forbid_special_code validate :forbid_special_code
validates :vat_rate, presence: true, if: 'vat_liable_in_foreign_country? && vat_no.blank?' validates :vat_rate, presence: true, if: -> { vat_liable_in_foreign_country? && vat_no.blank? }
validates :vat_rate, absence: true, if: :vat_liable_locally? validates :vat_rate, absence: true, if: :vat_liable_locally?
validates :vat_rate, absence: true, if: 'vat_liable_in_foreign_country? && vat_no?' validates :vat_rate, absence: true, if: -> { vat_liable_in_foreign_country? && vat_no? }
validates :vat_rate, numericality: { greater_than_or_equal_to: 0, less_than: 100 }, validates :vat_rate, numericality: { greater_than_or_equal_to: 0, less_than: 100 },
allow_nil: true allow_nil: true

View file

@ -16,7 +16,7 @@ end
module DomainNameRegistry module DomainNameRegistry
class Application < Rails::Application class Application < Rails::Application
#config.load_defaults 5.1 config.load_defaults 5.1
# Settings in config/environments/* take precedence over those specified here. # Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers # Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded. # -- all .rb files in that directory are automatically loaded.