Merge pull request #2093 from bf4/undef_unneeded_kernel_methods

Undef problematic Object methods
This commit is contained in:
Benjamin Fleischer 2017-04-30 16:51:19 -07:00 committed by GitHub
commit 81a13c4b32
2 changed files with 4 additions and 0 deletions

View File

@ -12,6 +12,9 @@ require 'active_model/serializer/lint'
# reified when subclassed to decorate a resource.
module ActiveModel
class Serializer
undef_method :select, :display # These IO methods, which are mixed into Kernel,
# sometimes conflict with attribute names. We don't need these IO methods.
# @see #serializable_hash for more details on these valid keys.
SERIALIZABLE_HASH_VALID_KEYS = [:only, :except, :methods, :include, :root].freeze
extend ActiveSupport::Autoload

View File

@ -1,6 +1,7 @@
# ActiveModelSerializers::Model is a convenient superclass for making your models
# from Plain-Old Ruby Objects (PORO). It also serves as a reference implementation
# that satisfies ActiveModel::Serializer::Lint::Tests.
require 'active_support/core_ext/hash'
module ActiveModelSerializers
class Model
include ActiveModel::Serializers::JSON