Add characters to Party model and template
This commit is contained in:
parent
ba22aad8d3
commit
201a5f4157
2 changed files with 5 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
class Party < ApplicationRecord
|
class Party < ApplicationRecord
|
||||||
##### ActiveRecord Associations
|
##### ActiveRecord Associations
|
||||||
belongs_to :user, optional: true
|
belongs_to :user, optional: true
|
||||||
|
has_many :characters, foreign_key: "party_id", class_name: "GridCharacter"
|
||||||
has_many :weapons, foreign_key: "party_id", class_name: "GridWeapon"
|
has_many :weapons, foreign_key: "party_id", class_name: "GridWeapon"
|
||||||
has_many :summons, foreign_key: "party_id", class_name: "GridSummon"
|
has_many :summons, foreign_key: "party_id", class_name: "GridSummon"
|
||||||
end
|
end
|
||||||
|
|
@ -2,6 +2,10 @@ object :party
|
||||||
|
|
||||||
attributes :id, :user_id, :shortcode
|
attributes :id, :user_id, :shortcode
|
||||||
|
|
||||||
|
node :characters do |p|
|
||||||
|
partial('grid_characters/base', :object => p.characters)
|
||||||
|
end
|
||||||
|
|
||||||
node :weapons do |p|
|
node :weapons do |p|
|
||||||
partial('grid_weapons/base', :object => p.weapons)
|
partial('grid_weapons/base', :object => p.weapons)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue