I have a model with lifecycle defined as follows:

lifecycle :state_field => 'status' do
    state :draft, :default => true
    state :published

    transition :init, { nil => :draft }, :available_to => :all
    transition :publish, { :draft => :published }, :available_to
=> :all
    transition :unpublish, { :published => :draft }, :available_to
=> :all
  end

I included the ":init" transition because all my existing data has
status set to nil after the migration and I'm not sure how to change
it. However, when I try to edit or create a new instance of my model
the status field does not appear on the form even though it should, as
far as I can tell. I've tried adding <transition-buttons /> as well
and nothing shows up. When I try to access /init, /publish, or /
unpublish directly I get this:

That operation is not allowed
Exception:
#<Hobo::PermissionDeniedError: Hobo::PermissionDeniedError>
params:
{"controller"=>"...",
 "action"=>"publish",
 "id"=>"..."}

In the console when I try to call the transition method I get:

Hobo::Model::Lifecycles::LifecycleError: No transition publish
available


Any ideas on why this is not working would be most helpful. I'm
probably overlooking something obvious but I've scoured the docs and
I'm pretty much out of ideas. Thank you!

-- 
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.

Reply via email to