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
-
Matt Jones October 26th, 2009 @ 08:19 PM
Found just after posting this - creator.rb already has an extract_attributes that does this. Will definitely be merged in later this week.
-
Matt Jones October 26th, 2009 @ 08:25 PM
- Assigned user set to Matt Jones
-
Bryan Larsen October 29th, 2009 @ 10:59 PM
- Tag changed from lifecycles, rapid to enhancement, lifecycles, rapid
- State changed from new to open
-
Matt Jones November 10th, 2009 @ 04:21 AM
- State changed from open to resolved
Fixed in a3c4ff4a1567a5440900c3ece0f317e0424e6d16
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป