Rails
Fast return of search/match conditional
def matching_attribute return if matches_on_attribute.empty? return matches_on_attribute.first if matches_on_attribute.length == 1 closest_attribute_match end
def matching_attribute return if matches_on_attribute.empty? return matches_on_attribute.first if matches_on_attribute.length == 1 closest_attribute_match end