-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new feature #83
Comments
What about the |
@fabrik42 need use it for each option but I write about all options at once. I think that add something like |
Hmm - I'm not sure about this. This basically makes your response schema unpredictable. You can make it work yourself with something like this (not tested) module ActsAsApi
class ApiTemplate < Hash
def add_if_present(val, options = {})
options[:if] ||= lambda { |model| model.try(val).present? }
add(val, options)
end
end
end So you can use |
@fabrik42 great, thank you! |
Lets add new config option that can delete any field from api response if field value is nil or false.
I suggest that it will be very useful.
The text was updated successfully, but these errors were encountered: