Add "welcome" asciicast on db init
parent
b4ed4edc9c
commit
20904489c4
@ -1,7 +1,13 @@
|
||||
# This file should contain all the record creation needed to seed the database with its default values.
|
||||
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
|
||||
# Mayor.create(name: 'Emanuel', city: cities.first)
|
||||
|
||||
# Create asciinema user
|
||||
|
||||
asciinema_user = User.find_by_username("asciinema") || User.create!(username: "asciinema", name: "asciinema", email: "support@asciinema.org")
|
||||
|
||||
# Create "welcome" asciicast
|
||||
|
||||
if asciinema_user.asciicasts.count == 0
|
||||
attrs = AsciicastParams.build(File.open("resources/welcome.json"), asciinema_user, nil)
|
||||
AsciicastCreator.new.create(attrs.merge(private: false, snapshot_at: 76.2))
|
||||
end
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue