diff --git a/app/views/content/display/_changelog.html.erb b/app/views/content/display/_changelog.html.erb index 1eac4ae4..3ddb4392 100644 --- a/app/views/content/display/_changelog.html.erb +++ b/app/views/content/display/_changelog.html.erb @@ -3,6 +3,7 @@ \ No newline at end of file + diff --git a/config/attributes/character.yml b/config/attributes/character.yml index 6d01c454..d30051c1 100644 --- a/config/attributes/character.yml +++ b/config/attributes/character.yml @@ -110,6 +110,8 @@ :label: Siblings - :name: children :label: Children + - :name: pets + :label: Pets :gallery: :label: Gallery :icon: photo_library diff --git a/lib/tasks/datafill.rake b/lib/tasks/datafill.rake new file mode 100644 index 00000000..eb3b4a5c --- /dev/null +++ b/lib/tasks/datafill.rake @@ -0,0 +1,32 @@ +namespace :datafill do + desc "Create 500 randomized characters" + task characters: :environment do + owner = User.last + + COLORS = ['Red', 'Green', 'Blue', 'Orange', 'White', 'Black', 'Yellow', 'Purple'] + + puts "Creating 500 characters for user #{owner.email}." + 500.times do + print '.' + character = Character.create( + user: owner, + name: [ + 'Alex', 'Bob', 'Carol', 'David', 'Evan', 'Fred', 'George', 'Harry', 'Isaac', 'Jacob', 'Kevin', 'Lars', 'Man', 'Nelly', 'OJ', 'Peter', + 'Dr. Q', 'Rusty', 'Steve', 'Ulysses', 'Victor', 'Wayne', 'Professor X', 'Zed' + ].sample + ' ' + COLORS.sample, + role: ['Protagonist', 'Antagonist', 'Foil', 'Supporting Character', 'Background Character'].sample, + gender: ['Male', 'Female', 'Other'].sample, + age: (1..100).to_a.sample, + height: "#{(1..7).to_a.sample}'#{(1..11).to_a.sample}\"", + weight: (50..350).to_a.sample, + haircolor: COLORS.sample, + eyecolor: COLORS.sample, + skintone: COLORS.sample, + fave_color: COLORS.sample, + ) + character.change_events.update_all(user_id: owner.id) + end + puts + puts "Done." + end +end