lib/faker/address.rb
def uk_county(city = nil)
        if city.blank?
          fetch('address.uk_county')
        else
          index = I18n.translate(:faker)[:address][:uk_city].index(city)
          county = I18n.translate(:faker)[:address][:uk_county][index] if index
          county ? county : fetch('address.uk_county')
        end  
      end
# Returns a uk county or the uk county associated with a uk city
# based on city with the same index as the county
Returns a uk county or the uk county associated with a uk city
based on city with the same index as the county
Returns a uk county or the uk county associated with a uk city based on city with the same index as the county
def uk_county(city = nil)
        if city.blank?
          fetch('address.uk_county')
        else
          index = I18n.translate(:faker)[:address][:uk_city].index(city)
          county = I18n.translate(:faker)[:address][:uk_county][index] if index
          county ? county : fetch('address.uk_county')
        end  
      end
def uk_county ( city = nil ) if city . blank? fetch ( 'address.uk_county' ) else index = I18n . translate ( :faker ) [ :address ] [ :uk_city ] . index ( city ) county = I18n . translate ( :faker ) [ :address ] [ :uk_county ] [ index ] if index county ? county : fetch ( 'address.uk_county' ) end end
Returns a uk county or the uk county associated with a uk city
based on city with the same index as the county
Returns a uk county or the uk county associated with a uk city based on city with the same index as the county
city