I''ve decided to add user authentication to my application using restful_authentication plugin. It has generated Account model with such fragment of code: def create logout_keeping_session! @account = Account.new(params[:account]) @account.register! if @account && @account.valid? success = @account && @account.valid? if success && @account.errors.empty? redirect_back_or_default(''/'') flash[:notice] = "Thanks for signing up! We''re sending you an email with your activation code." else flash[:error] = "We couldn''t set up that account, sorry. Please try again, or contact an admin (link is above)." render :action => ''new'' end end Everything is clear to me except @account.register! method. I cannot find any documentation about it. Where should I seek? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
From the README -- clip -- * --stateful: Builds in support for acts_as_state_machine and generates activation code. (@--stateful@ implies @--include-activation@). Based on the idea at [[http://www.vaporbase.com/postings/ stateful_authentication]]. Passing @--skip-migration@ will skip the user migration, and @--skip-routes@ will skip resource generation -- both useful if you''ve already run this generator. -- clip -- Using --stateful when running the restful_authentication generator it builds in support for acts_as_state_machine. If you are not using that plugin then generate restful_authentication without the --stateful option. @user.register! is a state transition. If you are unfamiliar with acts_as_state_machine, either read up on that and use it, or don''t use the --stateful option. P.S. @account in your case instead of @user. On Aug 1, 8:35 am, ddtm <dr.death...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''ve decided to add user authentication to my application using > restful_authentication plugin. It has generated Account model with > such fragment of code: > > def create > logout_keeping_session! > @account = Account.new(params[:account]) > @account.register! if @account && @account.valid? > success = @account && @account.valid? > if success && @account.errors.empty? > redirect_back_or_default(''/'') > flash[:notice] = "Thanks for signing up! We''re sending you an > email with your activation code." > else > flash[:error] = "We couldn''t set up that account, sorry. > Please try again, or contact an admin (link is above)." > render :action => ''new'' > end > end > > Everything is clear to me except @account.register! method. I cannot > find any documentation about it. Where should I seek?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks. I''ll read about that. On 1 авг, 18:10, Robert Walker <r0b3rt4...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> From the README > -- clip -- > * --stateful: Builds in support for acts_as_state_machine and > generates > activation code. (@--stateful@ implies @--include-activation@). > Based on the > idea at [[http://www.vaporbase.com/postings/ > stateful_authentication]]. Passing > @--skip-migration@ will skip the user migration, and @--skip-routes@ > will skip > resource generation -- both useful if you''ve already run this > generator. > -- clip -- > > Using --stateful when running the restful_authentication generator it > builds in support for acts_as_state_machine. If you are not using that > plugin then generate restful_authentication without the --stateful > option. > > @user.register! is a state transition. If you are unfamiliar with > acts_as_state_machine, either read up on that and use it, or don''t use > the --stateful option. > > P.S. @account in your case instead of @user. > > On Aug 1, 8:35 am, ddtm <dr.death...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I''ve decided to add user authentication to my application using > > restful_authentication plugin. It has generated Account model with > > such fragment of code: > > > def create > > logout_keeping_session! > > @account = Account.new(params[:account]) > > @account.register! if @account && @account.valid? > > success = @account && @account.valid? > > if success && @account.errors.empty? > > redirect_back_or_default(''/'') > > flash[:notice] = "Thanks for signing up! We''re sending you an > > email with your activation code." > > else > > flash[:error] = "We couldn''t set up that account, sorry. > > Please try again, or contact an admin (link is above)." > > render :action => ''new'' > > end > > end > > > Everything is clear to me except @account.register! method. I cannot > > find any documentation about it. Where should I seek?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---