# LoginEngine mod

**URL:** <https://www.ruby-forum.com/t/loginengine-mod/66054>\
**Category:** Engines Development\
**Created:** [August 23, 2006, 2:12am UTC](https://www.ruby-forum.com/t/loginengine-mod/66054 "2006-08-23T02:12:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![leveille](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/a88e57/32.png) [@leveille](https://www.ruby-forum.com/u/leveille)\
**Post date:** [August 23, 2006, 2:12am UTC](https://www.ruby-forum.com/t/loginengine-mod/66054/1 "2006-08-23T02:12:15Z")

</div>

Hi all,

I’ve looked thru the list and haven’t seen an answer for something I’m  
looking to do.

I just started a new project and we’re used to always using a user’s  
email address as the login. The LoginEngine, however, has a login  
field. I started poking thru the engine code to see how hard this  
might be to extend/override and it sorta looks like it might be a  
little involved.

My original idea was just to extend the User model and assign the  
email address to the login field behind the scenes. However, when I do  
this the validation fails (obviously). The login field is pretty  
critical to the whole structure and I was just wondering if someone  
else has tried and succeeded with this?

tia,

- jason

---

<div class="post-metadata">

**Author:** ![leveille](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/a88e57/32.png) [@leveille](https://www.ruby-forum.com/u/leveille)\
**Post date:** [August 23, 2006, 3:41pm UTC](https://www.ruby-forum.com/t/loginengine-mod/66054/2 "2006-08-23T15:41:27Z")

</div>

Jason L. wrote:

> I just started a new project and we’re used to always using a user’s  
> email address as the login. The LoginEngine, however, has a login  
> field. I started poking thru the engine code to see how hard this  
> might be to extend/override and it sorta looks like it might be a  
> little involved.

I just created a user.rb file in my application models directory that  
looks like this:

class User \< ActiveRecord::Base  
include LoginEngine::AuthenticatedUser  
before\_validation do |r|  
r.login = r.email  
end  
end

Seems to be working well so far.

Eric

---

<div class="post-metadata">

**Author:** ![leveille](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/a88e57/32.png) [@leveille](https://www.ruby-forum.com/u/leveille)\
**Post date:** [August 23, 2006, 4:03pm UTC](https://www.ruby-forum.com/t/loginengine-mod/66054/3 "2006-08-23T16:03:28Z")

</div>

Ah, perfect. And apologies for posting to the dev list as I didn’t  
see the users list.

Thx!

-jason
