I have the following in user.rb:

lifecycle do
  state :active, :default => true
  state :inactive
  state :invited

  ... some custom creators and transitions ...
end

First of all, whenever I create a new user using the "new user" form, the 
state is set to inactive. Any ideas why? The default used to be "inactive" 
but I clearly changed the code to what is shown above. 

Also, I'd like to have a checkbox input on the "new user" form that sets the 
state to active or inactive (along with taking some other actions) depending 
on whether the box is checked. I was trying to use a before_filter on the 
create action to set the state, etc. but I'm not sure how to access the 
User. For example, @user is nil. My current understanding is that a new User 
is instantiated with the state already set when the "new form" is loaded.

If it's unclear what I'm trying to do or if more detail is needed, please 
let me know. I appreciate any insight, as usual - I'm still pretty new at 
this. Thanks, 

Jim



-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/hobousers/-/_j_w038GTQUJ.
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/hobousers?hl=en.

Reply via email to