hobo_reorder does not obey acts_as_list :column directive
Reported by Henry Baragar | April 16th, 2010 @ 05:23 PM | in Hobo 1.1
I have a model that has the following directive:
acts_as_list :scope => :schedule, :column => :week_number
hobo_reoder fails to reorder this list because it is expecting the column name to be :position
Here is a patch to fix this defect:
--- hobo-1.0.0/lib/hobo/model_controller.rb.orig 2010-04-14 17:14:22.742935855 -0400
+++ hobo-1.0.0/lib/hobo/model_controller.rb 2010-04-16 12:16:41.544183904 -0400
@@ -754,7 +754,8 @@
ordering = params["#{model.name.underscore}_ordering"]
if ordering
ordering.each_with_index do |id, position|
- model.find(id).user_update_attributes(current_user, :position => position+1)
+ object = model.find(id)
+ object.user_update_attributes!(current_user, object.position_column => position+1)
end
hobo_ajax_response || render(:nothing => true)
else
Comments and changes to this ticket
-
Bryan Larsen April 16th, 2010 @ 07:13 PM
- Milestone set to Hobo 1.1
- Tag changed from defect to defect, model-controller
- State changed from new to open
- Assigned user set to Bryan Larsen
-
Bryan Larsen April 17th, 2010 @ 04:11 AM
- State changed from open to resolved
(from [51582ba146f724553754427d7f32c2428e371d28]) [#702 state:resolved] hobo_reorder ignores position_column http://github.com/tablatom/hobo/commit/51582ba146f724553754427d7f32...
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 ยป
People watching this ticket
Tags
Referenced by
- 702 hobo_reorder does not obey acts_as_list :column directive (from [51582ba146f724553754427d7f32c2428e371d28]) [#702 s...