Skip to content

Rake task adminpanel:populate

Jose Ramon edited this page Apr 24, 2014 · 7 revisions

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

supportes parameters for type are

  • nothing value will be Lorem ipsum dolor sit amec
  • name value will be a prefix, a name and a last name
  • category value will be a category name
  • description or lorem value will be a lorem ipsum between 60 and 80 words
  • lorem_name or sentence value will be a lorem ipsum [1..4] words
  • number value will be a number between 1 and 5000
  • url generates a random url
  • 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