always include awakening field in collection character response
This commit is contained in:
parent
e97b0ade55
commit
689aa96645
1 changed files with 7 additions and 5 deletions
|
|
@ -7,11 +7,13 @@ module Api
|
||||||
:ring1, :ring2, :ring3, :ring4, :earring,
|
:ring1, :ring2, :ring3, :ring4, :earring,
|
||||||
:created_at, :updated_at
|
:created_at, :updated_at
|
||||||
|
|
||||||
field :awakening, if: ->(_, obj, _) { obj.awakening.present? } do |obj|
|
field :awakening do |obj|
|
||||||
{
|
if obj.awakening.present?
|
||||||
type: AwakeningBlueprint.render_as_hash(obj.awakening),
|
{
|
||||||
level: obj.awakening_level
|
type: AwakeningBlueprint.render_as_hash(obj.awakening),
|
||||||
}
|
level: obj.awakening_level
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
association :character, blueprint: CharacterBlueprint
|
association :character, blueprint: CharacterBlueprint
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue