method
const_missing
v4.2.9 -
Show latest stable
- Class:
ActiveSupport::JSON::Encoding
const_missing(name)public
Deprecate CircularReferenceError
# File activesupport/lib/active_support/json/encoding.rb, line 149
def const_missing(name)
if name == :CircularReferenceError
message = "The JSON encoder in Rails 4.1 no longer offers protection from circular references. " "You are seeing this warning because you are rescuing from (or otherwise referencing) " "ActiveSupport::Encoding::CircularReferenceError. In the future, this error will be " "removed from Rails. You should remove these rescue blocks from your code and ensure " "that your data structures are free of circular references so they can be properly " "serialized into JSON.\n\n" "For example, the following Hash contains a circular reference to itself:\n" " h = {}\n" " h['circular'] = h\n" "In this case, calling h.to_json would not work properly."
ActiveSupport::Deprecation.warn message
SystemStackError
else
super
end
end