Skip to content

Commit a256139

Browse files
no serializing method in proxy
1 parent b8c8472 commit a256139

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/active_model/version_serializer.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
module ActiveModel
77
class VersionSerializer
8+
# make sure we move serialization to the version
9+
[:as_json, :to_json, :serializable_hash].each do |method|
10+
undef_method method if instance_methods.include?(method)
11+
end
812

913
class_attribute :_versions, :_default, :_root, :_name
1014
self._versions, self._default = {}, :v1
@@ -89,7 +93,6 @@ def self.version(version, &block)
8993
self._versions = self._versions.merge({version => vklass})
9094
end
9195

92-
private
9396
def method_missing(method, *args)
9497
if @vinstance.respond_to?(method)
9598
@vinstance.send(method, *args)

0 commit comments

Comments
 (0)