# What and where is the method register! in restful authentication?

**URL:** <https://www.ruby-forum.com/t/what-and-where-is-the-method-register-in-restful-authentication/159082>\
**Category:** Rails\
**Created:** [January 31, 2009, 10:16am UTC](https://www.ruby-forum.com/t/what-and-where-is-the-method-register-in-restful-authentication/159082 "2009-01-31T10:16:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomasalbert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/4bbf92/32.png) [@thomasalbert](https://www.ruby-forum.com/u/thomasalbert)\
**Post date:** [January 31, 2009, 10:16am UTC](https://www.ruby-forum.com/t/what-and-where-is-the-method-register-in-restful-authentication/159082/1 "2009-01-31T10:16:19Z")

</div>

A newbie question - I am learning restful authentication but I cant  
find what or where the method register! is when used in the following  
code:

@user.register! if @user && @user.valid?

Thanks.

---

<div class="post-metadata">

**Author:** ![thomasalbert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/4bbf92/32.png) [@thomasalbert](https://www.ruby-forum.com/u/thomasalbert)\
**Post date:** [January 31, 2009, 12:05pm UTC](https://www.ruby-forum.com/t/what-and-where-is-the-method-register-in-restful-authentication/159082/2 "2009-01-31T12:05:50Z")

</div>

User acts as a state machine. Transitions automatically get methods  
that are named after them with a “!” at the end. Look for a  
transition called register and it shows from what state to what state  
this “register” can occur.

Ramon T.

On Sat, Jan 31, 2009 at 5:15 PM, thomasalbert

---

<div class="post-metadata">

**Author:** ![thomasalbert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/4bbf92/32.png) [@thomasalbert](https://www.ruby-forum.com/u/thomasalbert)\
**Post date:** [February 1, 2009, 5:11am UTC](https://www.ruby-forum.com/t/what-and-where-is-the-method-register-in-restful-authentication/159082/3 "2009-02-01T05:11:07Z")

</div>

Thanks Ramon,

Never heard of finite state machines or acts\_as\_state\_machine before,  
I have been chasing it on the web - more to learn.
