You might want to look at this a little closer before you submit a bug
report.  For instance, if you make two changes:

1) FILE: app/controllers/users_controller.rb
    IN: def create
    FROM: @user.register! if @user && @user.valid?
    TO: @user.save! if @user && @user.valid?

2) FILE: vendor/plugins/restful-authentication/lib/authorization/
aasm_roles.rb
    FROM: aasm_event :register do
    TO: aasm_event :save do

You can now follow the sequence:

>> record = User.new({ :login => 'quire', :email => '[email protected]', 
>> :password => 'enquire', :password_confirmation => 'enquire' })
=> #<User id: nil, login: "quire", name: "", email:
"[email protected]", crypted_password: nil, salt: nil, created_at:
nil, updated_at: nil, remember_token: nil, remember_token_expires_at:
nil, activation_code: nil, activated_at: nil, state: "passive",
deleted_at: nil>
>> record.save
=> true
>> record
=> #<User id: nil, login: "quire", name: "", email:
"[email protected]", crypted_password: nil, salt: nil, created_at:
nil, updated_at: nil, remember_token: nil, remember_token_expires_at:
nil, activation_code: "8508423584b5c775a60939f9d1966653cd8ea493",
activated_at: nil, state: "pending", deleted_at: nil>

Of course, you can not actually save record to the database anymore
since you've masked ActiveRecord's save method.  There's probably a
way to clear that up as well but that's not your problem here.

As far as the "passive" - "pending" issue, I suspect you're not
catching your record early enough in it's aasm life.

These are all good questions to ask the rubyist-aasm folks - I just
wouldn't open the conversation with a !!!BUG REPORT!!! salvo
iynwim ;-)
On Apr 21, 6:28 am, Joshua Muheim <[email protected]>
wrote:
> RickOlson wrote:
> > Perhaps the AASM library is buggy.   I haven't used it in ages, but I
> > seem to recall some issue of it not calling the enter transition unless
> > the event was manually triggered.  That's what the behavior above
> > suggests.
>
> > If the library is giving you hassles, then generate the authentication
> > code without the aasm flag.  This code was submitted to me by someone
> > else, and I don't have much experience with it.
>
> First of all thanks a lot for taking this serious and answering me upon
> my request,Rick. :-)
>
> What do you suggest? Should I try to find the bug in AASM and submit a
> fix? I don't like to use workarounds for evidently buggy software... ;-)
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to