Nozim
Nozim

Reputation: 597

Authlogic activation problems

Sorry if this question was asked before but I got trouble with authlogic when I try to create UserSession instance in rails console like `UserSession.create! :login => 'blabla', :passw...' I get:

Authlogic::Session::Activation::NotActivatedError: You must activate the Authlogic::Session::Base.controller with a controller object before creating objects

Rails version: 3.0.4

Maybe I missed something? I'll be appreciated for any help :)

Upvotes: 1

Views: 3790

Answers (1)

Mailo Světel
Mailo Světel

Reputation: 26060

It seems you have to add somthing like

Authlogic::Session::Base.controller = Authlogic::ControllerAdapters::RailsAdapter.new(self)

into your config/environment.rb or somewhere.

Hint taken from article Working with Authlogic in script/console

Upvotes: 4

Related Questions