-
-
Save movstox/8bb593443e5729725505e06b7b67bea7 to your computer and use it in GitHub Desktop.
Activate Authlogic in Console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if defined?(ActiveRecord::Base) && defined?(Authlogic) | |
controller = ApplicationController.new | |
require 'action_controller/test_case' | |
controller.instance_variable_set(:@_request, ActionController::TestRequest.new) | |
controller.instance_variable_set(:@_response, ActionController::TestResponse.new) | |
Authlogic::Session::Base.controller = Authlogic::ControllerAdapters::RailsAdapter.new(controller) | |
end | |
UserSession.new( User.first ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment