books edition by admin
This commit is contained in:
parent
5095f63fd7
commit
e36cc36947
10 changed files with 119 additions and 20 deletions
26
db/seeds.rb
26
db/seeds.rb
|
@ -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
|
||||
},
|
||||
])
|
Loading…
Add table
Add a link
Reference in a new issue