search for: move_low

Displaying 6 results from an estimated 6 matches for "move_low".

Did you mean: move_lock
2006 Jul 23
2
REST controller with up and down for model that acts_as_list
...at a list of products for a particular department I have up and down buttons to re-order the products. Currently my controller is something like this class ProductController < ApplicationController def up Product.find(params[:id]).move_higher end def down Product.find(params[:id]).move_lower end end This doesn''t fit the the REST idea of only UPDATE for making changes. How do I rework this to be more REST friendly? Thanks, Peter
2007 Jul 12
1
acts as list -- adding or moving new item to new location
right now i''m adding an item to my ''list'' but i''m unsure how to move it to a certain spot in the list. specifically i want to put it at the bottom of the list. i assumed that if i did something like parent.children << new_child then the ''position'' field in the child table would be given some sensible default by rails but instead
2006 May 15
0
acts_as_list, move_higher, odd indexing behaviour?
...rted here? http://blog.nominet.org.uk/tech/Web/2006/03/06/Using_acts_as_list_in_... i.e. element access and move_higher require an odd indexing scheme to work. I''m personally finding that I can''t seem to change the list element positioning in a rails unit test using move_higher/move_lower, although move_to_top works. (See code following below) Cheers, N ---- # model defs class AccountTransaction < ActiveRecord::Base has_many :credits, :foreign_key => ''transaction_id'', :order => ''position ASC'' end class Credit < ActiveRecord::...
2006 Sep 09
1
Acts as tree and list?
...del looks like class ModelName < ActiveRecord::Base acts_as_tree :order => "position" acts_as_list :scope => :parent end the table has fields position, :integer parent_id, :integer This kinda of seems to work. Except if I do something like @modelinstance.children.first.move_lower #parent_id = 0 But now @modelinstance.children.first.position = 1 # which is correct now, it used to be 0 @modelinstance.children.second.position = 1 # bad, can''t have to things with same position Any tips for the right way to do this? Thanks --~--~---------~--~----~------------~-...
2010 Dec 23
6
Difference between rake test:units and individually running ruby -I test test/unit/something_test.rb ?
Here''s my issue: running ruby -I test test/unit/something_test.rb for each of my unit tests works perfectly. However, running rake test:units brings errors in all of them - some object becomes nil for some reason. Why might this be happening? Specifics: the object that is successfully not nil when I run the unit tests one-by-one but becomes nil when I do rake test:units is defined like
2006 Apr 30
4
acts_as_ordered_tree
I need an ordered (sortable tree) and I just was thinking if somehting like this is possible: class Item< ActiveRecord::Base acts_as_tree :order => "position" acts_as_list :scope => ''parent_id = #{self.id}'' end For my understanding mixing of two acts_as should be p?ssible, at least in this case, right? Unfortunatly the :scope is not working, I am not