Fix Rubocop issues after Ruby upgrade

This commit is contained in:
Maciej Szlosarczyk 2018-04-27 15:01:39 +03:00
parent 3c1125879c
commit 15a651e51b
No known key found for this signature in database
GPG key ID: 41D62D42D3B0D765
18 changed files with 25 additions and 26 deletions

View file

@ -168,7 +168,7 @@ class EppController < ApplicationController
# validate legal document's type here because it may be in most of the requests
@prefix = nil
if element_count('extdata > legalDocument') > 0
if element_count('extdata > legalDocument').positive?
requires_attribute('extdata > legalDocument', 'type', values: LegalDocument::TYPES, policy: true)
end
@ -279,7 +279,7 @@ class EppController < ApplicationController
def optional(selector, *validations)
full_selector = [@prefix, selector].compact.join(' ')
el = params[:parsed_frame].css(full_selector).first
return unless el && el.text.present?
return unless el&.text.present?
value = el.text
validations.each do |x|