Restrict serializable_hash to accepted options, only for tests

This commit is contained in:
Benjamin Fleischer
2016-04-13 00:30:47 -05:00
parent aad7779a3f
commit 929a5d0a51
7 changed files with 57 additions and 3 deletions

View File

@@ -18,6 +18,8 @@ require 'active_model/serializer/type'
# reified when subclassed to decorate a resource.
module ActiveModel
class Serializer
# @see #serializable_hash for more details on these valid keys.
SERIALIZABLE_HASH_VALID_KEYS = [:only, :except, :methods, :include, :root].freeze
extend ActiveSupport::Autoload
autoload :Adapter
autoload :Null