lib/countries/country/finder_methods.rb in countries-6.0.0 vs lib/countries/country/finder_methods.rb in countries-7.0.0
- old
+ new
@@ -27,12 +27,12 @@
end
end
def method_missing(method_name, *arguments)
matches = method_name.to_s.match(FIND_BY_REGEX)
- return_all = matches[1]
super unless matches
+ return_all = matches[1]
countries = find_by(matches[3], arguments[0], matches[2])
return_all ? countries : countries.last
end
@@ -70,10 +70,9 @@
def searchable_attribute?(attribute)
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 + %i[name names any_name]
+ instance_methods - UNSEARCHABLE_METHODS + %i[any_name]
end
end
end