books edition by admin

This commit is contained in:
Karol Selak 2021-03-21 20:30:25 +01:00
parent 5095f63fd7
commit e36cc36947
10 changed files with 119 additions and 20 deletions

View file

@ -31,21 +31,25 @@ authors = Author.create([
},
])
BookAuthor.create([
books.first.authors << authors.first
books.second.authors << authors.first
books.third.authors << authors.second
books.third.authors << authors.third
User.create([
{
book: books.first,
author: authors.first
email: 'abc@o2.pl',
password: 'aaaaaaaa',
role: :admin
},
{
book: books[1],
author: authors.first
email: 'abcd@o2.pl',
password: 'aaaaaaaa',
role: :customer
},
{
book: books[2],
author: authors[1]
},
{
book: books[2],
author: authors[2]
email: 'abcde@o2.pl',
password: 'aaaaaaaa',
role: :customer
},
])