mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
Merge branch 'master' of https://git.heroku.com/production-1
This commit is contained in:
commit
c9059ddfa8
@ -3,6 +3,7 @@
|
||||
<ul class="collection">
|
||||
<% content.change_events.reverse.each do |change_event| %>
|
||||
<li class="collection-item">
|
||||
<% next if change_event.user.nil? %>
|
||||
<%= (change_event.user == current_user) ? 'You' : link_to(change_event.user.name, change_event.user) %>
|
||||
<%= change_event.action %> this <%= change_event.content_type.downcase %>
|
||||
<span class="grey-text"><%= time_ago_in_words change_event.created_at %> ago</span>.
|
||||
@ -60,4 +61,4 @@
|
||||
<%= content.class.name %> <%= content.name %> was created by <%= link_to content.user.name, content.user %>
|
||||
<span class='grey-text'><%= time_ago_in_words content.created_at %> ago</span>.
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
@ -110,6 +110,8 @@
|
||||
:label: Siblings
|
||||
- :name: children
|
||||
:label: Children
|
||||
- :name: pets
|
||||
:label: Pets
|
||||
:gallery:
|
||||
:label: Gallery
|
||||
:icon: photo_library
|
||||
|
||||
32
lib/tasks/datafill.rake
Normal file
32
lib/tasks/datafill.rake
Normal file
@ -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
|
||||
Loading…
Reference in New Issue
Block a user