I have created an admin subsite and I am trying to add the ability to
deactivate users. This is what my users model lifecycle looks like.
lifecycle do
state :active, :default => true
state :inactive
create :signup, :available_to => "Guest",
:params =>
[:name, :email_address, :password, :password_confirmation],
:become => :active
transition :request_password_reset, { :active
=> :active }, :new_key => true do
UserMailer.forgot_password(self, lifecycle.key).deliver
end
transition :reset_password, { :active => :active }, :available_to
=> :key_holder,
:params => [ :password, :password_confirmation ]
transition :activate, { :inactive => :active }, :available_to =>
"acting_user if acting_user.administrator?"
transition :deactivate, { :active => :inactive }, :available_to =>
"acting_user if acting_user.administrator?"
end
My problem is now, in the page when I try to call <transition-buttons /
> I get undefined method `administrator?' for nil:NilClass
This is the same way the transitions were created in the Hobo 1.3 book
on page 295. Any help would be appreciated.
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" 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/hobousers?hl=en.