Books admin#66
Conversation
|
Still in development, but pull and test if you want |
| @@ -0,0 +1,4 @@ | |||
| class MakeBookOwnerNotNull < ActiveRecord::Migration[7.1] | |||
| def change | |||
| end | |||
| @@ -0,0 +1,5 @@ | |||
| class AddOwnerToBooks < ActiveRecord::Migration[7.1] | |||
| def change | |||
| add_reference :books, :owner, foreign_key: { to_table: :users } | |||
There was a problem hiding this comment.
This is normal rails way to tie 2 tables together, but we don't want admin users to own books, we just want books to have a list of editors. An array of strings would be good, or maybe a jsonb field to have e.g. {"regan" => "regan.ryan.nz@gmail.com"} yea that's better because then we can list the names of the owners, since some people have weird emails
| # become the chorus for this tune" | ||
| end | ||
|
|
||
| def song_diff(old_lyrics, new_lyrics, context_lines: 2) |
There was a problem hiding this comment.
It would be good to do git rebase -i master and drop the email commit, since it's not part of this feature
| songs: songs, | ||
| languages: languages | ||
| languages: languages, | ||
| admin: owner_id || [71], |
There was a problem hiding this comment.
User.system_user.id would be much better than "71"
Also you have "integer OR array" which might lead to problems.
But yea I think would be good to shift to jsonb as per another comment somewhere
http://localhost:3000/books/admin