Ash FrameworkAF
Ash Framework3mo ago
6 replies
AngryBadger

Ignoring a relationship on specific update actions

I have an update action that toggles just a flag on a CrewMember resource. CrewMember's have many Weapons, which are set up using change manage_relationship(:weapons, type: :direct_control). I created a new update action called set_leader, which can be called in scopes of the application where the full list of Weapons is not loaded. Is there a way to set this action to not wipe out the list of Weapons when only %{ "is_leader" => true } is passed as a param?
Solution
that's not calling your set_leader action, that's calling the
update
action
Was this page helpful?