save callback broken on Rails 3.0.7 console

22 views
Skip to first unread message

Todd A. Jacobs

unread,
Oct 21, 2011, 12:26:21 PM10/21/11
to Authlogic
I'm getting errors from the save callback when trying to create user
sessions on the rails console. This happens with both the authlogic
3.0.3 and 3.1.0 gems. I've seen other people asking about this error
on Google, and there's an open issue on GitHub (#148), but haven't
seen anyone with a fix or workaround--or even an explanation. Any
ideas?

ruby-1.8.7-p302 :001 > Authlogic::Session::Base.controller =
Authlogic::ControllerAdapters::RailsAdapter.new(self)
=> #<Authlogic::ControllerAdapters::RailsAdapter:0xb257a244
@controller=#<Object:0xb7609958 @prompt={:RETURN=>" => %s
\n", :PROMPT_I=>"ruby-1.8.7-p302 :%03n > ", :PROMPT_N=>"ruby-1.8.7-
p302 :%03n?> ", :PROMPT_S=>"ruby-1.8.7-p302 :%03n%l>
", :PROMPT_C=>"ruby-1.8.7-p302 :%03n > ", :AUTO_INDENT=>true}
ruby-1.8.7-p302 :002 > UserSession.create(User.first, true)
NoMethodError: undefined method `request' for #<Object:0xb7609958>
from /home/codegnome/.rvm/gems/ruby-1.8.7-p302@rails3/gems/
authlogic-3.1.0/lib/authlogic/controller_adapters/abstract_adapter.rb:
34:in `request'
from /home/codegnome/.rvm/gems/ruby-1.8.7-p302@rails3/gems/
authlogic-3.1.0/lib/authlogic/session/magic_columns.rb:61:in
`update_info'
from /home/codegnome/.rvm/gems/ruby-1.8.7-p302@rails3/gems/
activesupport-3.0.7/lib/active_support/callbacks.rb:415:in
`_run_before_save_callbacks'
from /home/codegnome/.rvm/gems/ruby-1.8.7-p302@rails3/gems/
activesupport-3.0.7/lib/active_support/callbacks.rb:94:in `send'
from /home/codegnome/.rvm/gems/ruby-1.8.7-p302@rails3/gems/
activesupport-3.0.7/lib/active_support/callbacks.rb:94:in
`run_callbacks'
from /home/codegnome/.rvm/gems/ruby-1.8.7-p302@rails3/gems/
authlogic-3.1.0/lib/authlogic/session/callbacks.rb:84:in `before_save'
from /home/codegnome/.rvm/gems/ruby-1.8.7-p302@rails3/gems/
authlogic-3.1.0/lib/authlogic/session/existence.rb:68:in `save'
from /home/codegnome/.rvm/gems/ruby-1.8.7-p302@rails3/gems/
authlogic-3.1.0/lib/authlogic/session/existence.rb:30:in `create'
from (irb):2
Reply all
Reply to author
Forward
0 new messages