I have a rail controller
class Controllername < application
def method1
obj = API_CALL
session =obj.access_token
redirect_to redirect_url
end
def method2
obj.call_after_sometime
end
end
I call some API in method1, getting the object and keeping the access token and secrets in the session. method1completes the action.
After some time I’m calling method2, now the session (access token, secrets) is saved correctly.
But now inside method2I need to call the API call_after_sometimeusing OBJECT obj. But now it is objunavailable because I did not store it in the session (we get an SSL error storing encrypted objects).
I want to know what is the best way to save objin method1so that it can be used later inmethod2
EDIT:
when I tried to execute a Rails.cache or session, I get an error
TypeError - no _dump_data is defined for class OpenSSL::X509::Certificate
Google, , .