read action returning a boolean
Hi, I'm trying to make a resource to represent some global boolean flags for some features in my application. I'm just having trouble figuring out how to writing an action to return a boolean.
The behaviour I'd like for
is_enabled?
is for it to return true
if the feature of the specified name doesn't exist or return true
if the feature of the specified name does exist and is_enabled
is true, otherwise return false.
How can I make an action return a boolean and how can I get it to have that custom logic?
Cheers, Chris.2 Replies
Hey Chris. You probably want split it into two actions - one read which gets the data you need and a generic action which can return an arbitrary type which calls the read action and returns the required Boolean.
thanks, having a go now
I wasn't able to figure out how to use a generic action but this does the job