Forum: Rails Engines LoginEngine: undefined method `logged_in_at='

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Steve O. (Guest)
on 2006-01-25 17:14
(Received via mailing list)
Hi, just installed the LoginEngine.

I keep getting this error when I log in:

undefined method `logged_in_at='

That is on line 22 of the user_controller:

def login
    return if generate_blank
    @user =[:user]) # what does this achieve?
    if session[:user] = User.authenticate(params[:user][:login],
      session[:user].logged_in_at =
      flash[:notice] = 'Login successful'
      redirect_to_stored_or_default :action => 'home'
      @login = params[:user][:login][:warning] = 'Login unsuccessful'

It is logging me in. But tripping up because it can't find a logged_in

If I comment out that line, it works fine. Any ideas what is wrong? And
whether commenting out this line will have consequences?


James A. (Guest)
on 2006-01-25 17:26
(Received via mailing list)
The only function that line serves is to track when a particular user
logged in, so commenting it out shouldn't be a huge issue.

As to *why* it's causing you a problem... the line should simply
assign the current time into the logged_in_at field of the user table.
Did you use the migrations with the login engine to create your user
table? Can you verify that the table has a logged_in_at field?

- james
Steve O. (Guest)
on 2006-01-25 18:51
(Received via mailing list)
Thanks James.

I did not use migrations. I created my user table using the below from
bottom of the README file:

You need a database table corresponding to the User model. This is
as a Rails Schema file, but the schema is presented below for

  mysql syntax:
  CREATE TABLE users (
    login VARCHAR(80) NOT NULL,
    salted_password VARCHAR(40) NOT NULL,
    email VARCHAR(60) NOT NULL,
    firstname VARCHAR(40),
    lastname VARCHAR(40),
    salt CHAR(40) NOT NULL,
    verified INT default 0,
    role VARCHAR(40) default NULL,
    security_token CHAR(40) default NULL,
    token_expiry DATETIME default NULL,
    deleted INT default 0,
    delete_after DATETIME default NULL

This does not contain a logged_in_at field. I think that is my problem.

James A. (Guest)
on 2006-01-25 19:00
(Received via mailing list)
Gah - that SQL is now woefully out of date - I need to remove it.
Thanks, sorry for the confusion :)

- james
Steve O. (Guest)
on 2006-01-25 19:43
(Received via mailing list)
No problem, thanks for your help.
Bakki K. (Guest)
on 2006-01-25 21:35
(Received via mailing list)

How about updating the sql rather than removing it? It was very helpful
me to understand the engine.

-bakki kudva
James A. (Guest)
on 2006-01-26 01:51
(Received via mailing list)
Patches are *very* welcome, even to documentation.

(hint, hint)

- james
Bakki K. (Guest)
on 2006-01-26 15:59
(Received via mailing list)
Hi James,

I'd be happy to! I guess I'll have to install the svn version to
the diffs. When I first tried to install engines using svn it it didn't
work. (on Debian Sarge with subversion 1.1.4-2) Don't recall what the
messages were. So I just installed using 'script/plugin install'. Now
question is do I need to uninstall what I have before trying svn version
can I install over it? What is the procedure for an uninstall? Just
vendor/engines dir along with the tables? If I am successful in
the login/user engines I can submit those patches as well.. may take me
while to figure it all out  :)


James A. (Guest)
on 2006-01-26 16:02
(Received via mailing list)
Patches don't need to be in diff format, but it does help. If you do
create any, they should be submitted to the Trac site (linked from

To replace a plugin with another version, you can just move the
existing folder out of the way (either into another folder outside of
/vendor/plugins, or into /dev/null. i.e. oblivion) and replace it with
the new version. SVN is currently the only way to get specific
versions of the plugins that I've put up on, but
there's nothing special about the way that is set up. If you can't

  svn co

to work, googling around with your particular error message should
point you in the right direction.


- james
MorganHillJoe (Guest)
on 2006-04-08 22:46
I agree with Bakki. I just got bit by the same incorrect sql code on the
web page. We can do two things:

1. Fix the code, which would be nice
2. Indicate a little more clearly how to use the schema.rb file. I spent
some time trying to figure it out, but I couldn't. I want to learn it
eventually, but it's not my battle today. What's not clear to me at this
point is that it's somehow tied to migrations, but I'm just trying to
create a table, it seems like it should be one command.

Bakki K. wrote:
> James,
> How about updating the sql rather than removing it? It was very helpful
> to
> me to understand the engine.
> -bakki kudva
This topic is locked and can not be replied to.