lib/faker.rb
# You can add whatever you want to the locale file, and it will get caught here.
# E.g., in your locale file, create a
#   name:
#     girls_name: ["Alice", "Cheryl", "Tatiana"]
# Then you can call Faker::Name.girls_name and it will act like #first_name
You can add whatever you want to the locale file, and it will get caught here.
You can add whatever you want to the locale file and it will get caught here .
def method_missing(m, *args, &block)
        super unless @flexible_key
        if translation = translate(:faker)[@flexible_key][m]
          sample(translation)
        else
          super
        end
      end
def method_missing ( m , * args , & block ) super unless @flexible_key if translation = translate ( :faker ) [ @flexible_key ] [ m ] sample ( translation ) else super end end
You can add whatever you want to the locale file, and it will get caught here.
You can add whatever you want to the locale file and it will get caught here .
# Use the alternate form of translate to get a nil rather than a "missing translation" string
m
args
block