Skip to content

Rake task adminpanel:populate

joseramonc edited this page Oct 16, 2014 · 7 revisions

You can use bundle exec rake adminpanel:populate[n, model, field:type field2:type2...] to generate n records (n is an integer), model is Adminpanel::Model whose attributes are of the type field:type...

supportes parameters for type are

  • nothing or any of invalid option. Ramdom lorem 1..6 words
  • name Random name
  • category Faker::Commerce.product_name
  • description or lorem value will be a lorem ipsum between 60 and 80 words
  • number value will be a number between 1 and 5000
  • url Random url
  • lat random latitude for google maps
  • lng generates a longitude for google maps
  • lat_mid random latitude in merida for google maps
  • lng_mid generates a longitude in merida for google maps
  • id will serach for a random Adminpanel::Field and assign model.field_id to it
  • email will generate a valid email (don't match with name)
  • image will force the insantiation of the image but without a file, you'll just have the records in the database.

Clone this wiki locally