Displaying 1 result from an estimated 1 matches for "updated_family_id".
2006 Apr 01
3
acts_as_list with scope : position update problem?
...iveRecord::Base
belongs_to :family, :order => ''position''
acts_as_list :scope => ''family_id''
validates_uniqueness_of :position, :scope => ''family_id''
before_validation_on_update :reorder_positions
private
def reorder_positions
@updated_family_id = params[:person][:family_id]
unless @updated_family_id == self.family_id
self.move_to_bottom # reorder original list
params[:person][:family_id] =
Family.find_by_id(@updated_family_id).people.length + 1
end
end
end
When I update a Person by changing its family_id, I get this error
me...