#702 ✓resolved
Henry Baragar

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

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

Referenced by

Pages