-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ 🚧 #15, add
owner_id
column to rooms table
- Loading branch information
Showing
5 changed files
with
21 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
json.id room.id | ||
json.name room.name | ||
json.owner_id room.owner_id | ||
json.players room.players do |player| | ||
json.id player.id | ||
json.nickname player.nickname | ||
json.character player.character | ||
json.is_ready player.ready? | ||
json.role player.role | ||
json.is_owner player.id == room.owner_id | ||
end | ||
json.status room.status | ||
if room.status == 'playing' | ||
json.game_id room.games.last.id | ||
end | ||
json.game_id room.games.last.id if room.status == 'playing' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# https://github.com/side-project-at-SPT/split-rails/issues/15 | ||
class AddOwnerToRooms < ActiveRecord::Migration[7.1] | ||
def change | ||
add_column :rooms, :owner_id, :integer | ||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.