mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
fix uninitialized instance variable warning
Ruby warns that `@only` and `@except` are not initialized because if they are not passed in, they are never assigned. Remove circular require in array_serializer
This commit is contained in:
@@ -113,8 +113,8 @@ end
|
||||
@meta_key = options[:meta_key] || :meta
|
||||
@meta = options[@meta_key]
|
||||
@wrap_in_array = options[:_wrap_in_array]
|
||||
@only = Array(options[:only]) if options[:only]
|
||||
@except = Array(options[:except]) if options[:except]
|
||||
@only = options[:only] ? Array(options[:only]) : nil
|
||||
@except = options[:except] ? Array(options[:except]) : nil
|
||||
@key_format = options[:key_format]
|
||||
end
|
||||
attr_accessor :object, :scope, :root, :meta_key, :meta, :key_format
|
||||
|
||||
Reference in New Issue
Block a user