# \[LoginEngine\] making email editable but still unique

**URL:** <https://www.ruby-forum.com/t/loginengine-making-email-editable-but-still-unique/80044>\
**Category:** Engines\
**Created:** [December 20, 2006, 11:34pm UTC](https://www.ruby-forum.com/t/loginengine-making-email-editable-but-still-unique/80044 "2006-12-20T23:34:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hatless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/848f3c/32.png) [@hatless](https://www.ruby-forum.com/u/hatless)\
**Post date:** [December 20, 2006, 11:34pm UTC](https://www.ruby-forum.com/t/loginengine-making-email-editable-but-still-unique/80044/1 "2006-12-20T23:34:10Z")

</div>

Despite what LoginEngine wants me to do in an ideal world, I want my  
users to be able to change their email address, but I still want to  
enforce uniqueness.

When I throw caution to the wind and add ‘email’ to :changeable\_fields,  
I can see why there’s a warning against doing this, and it’s not because  
cats and dogs lie together. Instead, on updates, the  
“validates\_uniqueness\_of :email” declaration in my model is ignored. All  
of my other validations, including some I’ve added myself in the same  
file are being called.

I’ve tied looking through the source. I’ve tried – in my overridden  
do\_edit() methods – to explicitly call #save\_with\_validation. It makes  
no difference. Uniqueness is not being enforced.

Any thoughts?
