lib/countries/country/finder_methods.rb in countries-5.4.0 vs lib/countries/country/finder_methods.rb in countries-5.5.0
- old
+ new
@@ -55,13 +55,11 @@
def parse_attributes(attribute, val)
raise "Invalid attribute name '#{attribute}'" unless searchable_attribute?(attribute.to_sym)
attributes = Array(attribute.to_s)
- if attribute.to_s == 'any_name'
- attributes = %w[iso_long_name iso_short_name unofficial_names translated_names]
- end
+ attributes = %w[iso_long_name iso_short_name unofficial_names translated_names] if attribute.to_s == 'any_name'
[attributes, parse_value(val)]
end
def parse_value(value)
@@ -73,9 +71,9 @@
searchable_attributes.include?(attribute.to_sym)
end
def searchable_attributes
# Add name and names until we complete the deprecation of the finders
- instance_methods - UNSEARCHABLE_METHODS + [:name, :names, :any_name]
+ instance_methods - UNSEARCHABLE_METHODS + %i[name names any_name]
end
end
end