Add extra slots to Parties
This commit is contained in:
parent
00476ec86c
commit
e95baf7ee6
2 changed files with 6 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ class Api::V1::PartiesController < Api::V1::ApiController
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@party = Party.new(shortcode: random_string)
|
@party = Party.new(shortcode: random_string)
|
||||||
|
@party.extra = party_params['is_extra']
|
||||||
|
|
||||||
if current_user
|
if current_user
|
||||||
@party.user = current_user
|
@party.user = current_user
|
||||||
|
|
@ -38,6 +39,6 @@ class Api::V1::PartiesController < Api::V1::ApiController
|
||||||
end
|
end
|
||||||
|
|
||||||
def party_params
|
def party_params
|
||||||
params.require(:party).permit(:user_id)
|
params.require(:party).permit(:user_id, :is_extra)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -2,6 +2,10 @@ object :party
|
||||||
|
|
||||||
attributes :id, :user_id, :shortcode
|
attributes :id, :user_id, :shortcode
|
||||||
|
|
||||||
|
node :is_extra do |p|
|
||||||
|
p.extra
|
||||||
|
end
|
||||||
|
|
||||||
node :characters do |p|
|
node :characters do |p|
|
||||||
partial('grid_characters/base', :object => p.characters)
|
partial('grid_characters/base', :object => p.characters)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue