authlogic_rails3_example icon indicating copy to clipboard operation
authlogic_rails3_example copied to clipboard

Problem getting to run with Rails 3

Open rickcr opened this issue 15 years ago • 1 comments

I'm pretty new to Rails so maybe I'm doing stuff wrong, but I'm trying to get this to run using Rails3 and Ruby 1.9.2-preview3.

I've updated the Gemfile to 3.0.0 (removed .beta)

and did bundle install to update things, but after running rake, I end up with a ton of errors that look like:

UserSessionController when no user is authenticated GET 'new' assigns a new user_session as @user_session
 Failure/Error: @mock_user_session ||= mock_model(UserSession, stubs).as_null_object
 The mock_model method can only accept as its first argument:
    A String representing a Class that does not exist
    A String representing a Class that extends ActiveModel::Naming
    A Class that extends ActiveModel::Naming

Thanks for any help.

rickcr avatar Sep 02 '10 17:09 rickcr

I got this working by manually extending the UserSessions from ActiveModel::Naming :

class UserSession < Authlogic::Session::Base
  extend ActiveModel::Naming
end

borama avatar Jul 29 '11 18:07 borama