Skip to content

Commit

Permalink
Fix new rubocop warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Nov 17, 2020
1 parent 8d2fbc6 commit 2ecfd61
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/validators/characters_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class CharactersValidator < ActiveModel::EachValidator
INVALID_URL_CHARS = "/;.,?%#".freeze

def validate_each(record, attribute, value)
record.errors[attribute] << (options[:message] || I18n.t("validations.invalid_characters")) if /[#{INVALID_CHARS}]/.match?(value)
record.errors[attribute] << (options[:message] || I18n.t("validations.url_characters", :characters => INVALID_URL_CHARS)) if options[:url_safe] && /[#{INVALID_URL_CHARS}]/.match?(value)
record.errors[attribute] << (options[:message] || I18n.t("validations.invalid_characters")) if /[#{INVALID_CHARS}]/o.match?(value)
record.errors[attribute] << (options[:message] || I18n.t("validations.url_characters", :characters => INVALID_URL_CHARS)) if options[:url_safe] && /[#{INVALID_URL_CHARS}]/o.match?(value)
end
end
2 changes: 1 addition & 1 deletion lib/gpx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def parse_file(reader)
end

def points(&block)
return enum_for(:points) unless block_given?
return enum_for(:points) unless block

@possible_points = 0
@actual_points = 0
Expand Down

0 comments on commit 2ecfd61

Please sign in to comment.