Displaying 9 results from an estimated 9 matches for "move_high".
Did you mean:
move_higher
2006 May 15
0
acts_as_list, move_higher, odd indexing behaviour?
Hi,
[reposting to list, posting via google groups apparently didn''t work]
I''m trying to use acts_as_list for the first time.
Can anyone confirm the odd behaviour reported 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 AccountTransac...
2007 Mar 01
9
Active Record proposal/discussion for improvement
Hello,
I have started in "Ruby on Rails: Talk" a discussion about my problems
with current ActiveRecord implementation. Please take a look here:
http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/d40b754fc5872a99/47cff815df123b8a?lnk=gst&rnum=2
Regards
Oliver Paulus
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are
2006 Mar 22
10
Need for multiple acts_as_list
...tion DESC LIMIT 1". It adds 1 to this and stores
it in the new record.
I am thinking I might have a go at modifying acts_as_list to support
multiple occurrences, but first I''d be interested in people''s thoughts
on the best API for this. For example, the method "child.move_higher"
would have to become "child.move_higher_in_parent1" or
"child.parent1_list.move_higher". Are there any better suggestions?
The acts_as_list method could become:
acts_as_list :parent => :parent1, :scope => :parent1_id, :column =>
:position_within_parent1
An...
2006 Jul 23
2
REST controller with up and down for model that acts_as_list
...ist :scope => :department_id''
end
When I look 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
2006 Apr 01
3
acts_as_list with scope : position update problem?
...ss Person < ActiveRecord::Base
belongs_to :family, :order => ''position''
acts_as_list :scope => ''family_id''
validates_uniqueness_of :position, :scope => ''family_id''
end
Now, all this works fine, I can execute commands like
person.move_higher, person.move_to_bottom, etc. So the class behaves as
expected with acts_as_list, updating the position column all by itself :
>> @person = Person.find_by_id(2)
=> #<Person:0x239cd64 @attributes={"family_id"=>"1", "name"=>"Brian",
"...
2006 Jul 11
0
using acts_as_list storing the information in a session
...y
filled out.
I have order_items that I am adding to the order, and I have used the
acts_as_list within the order_item model.
My problem comes when i try and rearrange the order_items using the
following code:
def move_item_up
@order = find_order
@order.order_items[params[:id].to_i].move_higher
@order.reload
session[:order] = @order
render:partial => ''order_contents''
end
It gives me the following error:
ActiveRecord::RecordNotFound (Couldn''t find Order without an ID):
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_recor...
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
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