name:
girls_name: ["Alice", "Cheryl", "Tatiana"]
Then you can call Faker::Name.girls_name and it will act like #first_name
I added Faker::Config.locale = :en to environment.rb Added en: company: job_title: ["Accountant", "Customer Service Rep", "CEO"] to en.yml attempted to call Faker::Company.job_title and get an undefined method 'job_title' error Is this not correct? |
--
You received this message because you are subscribed to the Google Groups "Ruby Faker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-faker+...@googlegroups.com.
To post to this group, send email to ruby-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ruby-faker.
For more options, visit https://groups.google.com/groups/opt_out.
You just need to add faker: above the custom lists in your locale file
In en.yml
en:
faker:
company:
job_title: ["Accountant", "Customer Service Rep", "CEO"]
Now calling Faker::Company.job_title will return one of the list entries.
The documentation was just lacking that one little line.