#495 new
Ben Turner

User Session generation in Auth chapter

Reported by Ben Turner | January 2nd, 2012 @ 09:44 PM

Following the instructions in Chapter 14 (Auth), I ran the following commands:

rails generate model user
rails generate model user_session

...but then over the page, I saw that UserSession is not in fact an ActiveRecord::Base object, but an Authlogic::Session::Base object.

It would seem perhaps better to suggest the use of the generator specific to this gem. I note that the Railscast and main documentation of Authlogic point towards an older Rails2 style generator, but this blog post linked off the main Authlogic github wiki (http://tech.gregorymazurek.com/2011/01/03/rails-3-authlogic-could-n...) pointed me towards using the rails3-generators gem (which was already present but commented out in my default Gemfile, so presumably somewhat "standard" ?) which then provides the following instead :

rails genenerate Authlogic:session UserSession

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Shared Ticket Bins

People watching this ticket