mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Merge pull request #283 from morgoth/add-only-and-except-options-support
Add only and except options support
This commit is contained in:
@@ -363,6 +363,8 @@ module ActiveModel
|
||||
end
|
||||
|
||||
def include?(name)
|
||||
return false if options.key?(:only) && !Array(options[:only]).include?(name)
|
||||
return false if options.key?(:except) && Array(options[:except]).include?(name)
|
||||
send INCLUDE_METHODS[name]
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user