Allow ActiveRecord::Base.as_json to accept a frozen Hash by betesh · Pull Request #27945 · rails/rails · GitHub
As you may know, ActiveRecord::Base.as_json takes an (optional) options hash. That hash is modified internally, but Rails is nice enough to clone it first so that it doesn't change the thing you passed to it. If your thing was frozen however, it would cause it to blow up! How can this be so, I hear you ask. Well, when you clone an object, you also clone its frozen-ness. dup, on the other hand, does not do this, which turned out to be the solution. Case closed!