#516 ✓resolved
Matt Jones

Association name as parameter in lifecycle step almost works

Reported by Matt Jones | October 26th, 2009 @ 08:08 PM | in Hobo 1.0 - Final

Given a class like this:

class Something < AR::Base
  hobo_model

  belongs_to :other_thing

  lifecycle do
    transition :woot, :params => [:other_thing], :available_to => 'Admin'
  end
end

(details omitted for brevity)
This almost works out-of-the-box: the transition page correctly picks a select-one for the other_thing field. However, the do_woot action drops the parameter on the floor (as it's looking for a parameter called :other_thing, not the :other_thing_id generated by the select-one).

The solution is likely pretty straightforward; find if a param corresponds to a belongs_to and change the expected name in extract_attributes. Not sure what happens if you instead use a has_many as a parameter - may require more investigation.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Pages