Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Error about actions not being present when invoking trigger update #86

Closed
benilovj opened this Issue · 2 comments

2 participants

@benilovj

When executing the following code using the 0.3.5 gem:

trigger = client.triggers.find(id: 12345) # the found trigger has actions
trigger.conditions.any.first.value = "abcde"
trigger.save

I get the following error:

W, [2013-05-03T11:35:23.126733 #6638]  WARN -- : the server responded with status 422
W, [2013-05-03T11:35:23.126835 #6638]  WARN -- : /var/lib/gems/1.9.1/gems/faraday-0.8.7/lib/faraday/response/raise_error.rb:8:in `on_complete'
W, [2013-05-03T11:35:23.127217 #6638]  WARN -- :    {"error"=>"RecordInvalid", "description"=>"Record validation errors", "details"=>{"base"=>[{"description"=>"Trigger must contain at least one action"}]}}

even though the original trigger did in fact define actions. Am I doing something wrong?

@steved
Owner

Rule (views, macros, triggers, automations) update requests require the full payload. This should be fixed with b185f15, for now a workaround would be:

trigger = client.triggers.find(id: 12345) # the found trigger has actions
trigger.conditions.any.first.value = "abcde"
trigger.attributes.changes.replace(trigger.attributes)
trigger.save
@steved
Owner

Closing if there are no further problems.

@steved steved closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.