mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Make json api adapter 'include' option accept an array, accommodate comma delimited string for legacy reasons
This commit is contained in:
@@ -121,7 +121,9 @@ module ActiveModel
|
||||
end
|
||||
|
||||
def check_assoc(assoc)
|
||||
@options[:include].split(',').any? do |s|
|
||||
include_opt = @options[:include]
|
||||
include_opt = include_opt.split(',') if include_opt.is_a?(String)
|
||||
include_opt.any? do |s|
|
||||
s.match(/^#{assoc.gsub('.', '\.')}/)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user