Skip to content

Commit

Permalink
Undef problematic Object methods
Browse files Browse the repository at this point in the history
  • Loading branch information
bf4 committed Mar 31, 2017
1 parent 04125a0 commit 574b9a0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/active_model/serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
# 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.
alias __method__ method
undef :method # Avoid attribute names that conflict with Object methods.
# @see #serializable_hash for more details on these valid keys.
SERIALIZABLE_HASH_VALID_KEYS = [:only, :except, :methods, :include, :root].freeze
extend ActiveSupport::Autoload
Expand Down Expand Up @@ -117,13 +121,13 @@ def self.serialization_adapter_instance
config.serializer_lookup_enabled = true

# @deprecated Use {#config.collection_serializer=} instead of this. Is
# compatibilty layer for ArraySerializer.
# compatibility layer for ArraySerializer.
def config.array_serializer=(collection_serializer)
self.collection_serializer = collection_serializer
end

# @deprecated Use {#config.collection_serializer} instead of this. Is
# compatibilty layer for ArraySerializer.
# compatibility layer for ArraySerializer.
def config.array_serializer
collection_serializer
end
Expand Down

0 comments on commit 574b9a0

Please sign in to comment.