Store request.headers in a serialized model attribute
- by Horace Loeb
Here's my model:
class Comment < ActiveRecord::Base
serialize :request_headers
end
But when I try to do @comment.request_headers = request.headers I get a TypeError (can't dump anonymous class Class) exception.
Another way to ask my question: how can I convert request.headers into a Hash? It uses a Hash under the covers so this should be easy, no?