I am patching a concern in the Devise Token Auth gem.
I have it working with alias_method_chain
but am wondering if I can use module#prepend
instead in this scenario?
Note: We are on ruby 2.2.x
Existing:
DeviseTokenAuth::Concerns::User.module_eval do
def token_validation_response_with_customer_info
json = token_validation_response_without_customer_info
# add some customer stuff based on has_role? check
json
end
alias_method_chain :token_validation_response, :customer_info
end