Displaying 20 results from an estimated 10000 matches similar to: "acts_as_list query"
2009 Aug 19
10
acts_as_list / acts_as_tree / acts_as_nested_set - which one
I am creating forum application which needs usage of acts_as_list or
acts_as_tree or acts_as_nested_set.
I am unable to decide among these. please could some one recommend from
their experience?
--
Posted via http://www.ruby-forum.com/.
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
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
2005 Apr 20
4
acts_as_list and single table inheritance
in a single table inheritance model, rails will automatically set the
scope for acts_as_list to the ''type'' field as well as any other scope
conditions we provide.
Is there a way to disable this? i want to use STI but I want
acts_as_list to disregard the class type when getting/setting
positions.
thanks
alan
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
2007 May 15
4
Way to mark record as main?
I was curious if there was a built in feature in ActiveRecord or a
plugin, but I basically have a database for phone numbers. I want a user
to be able to make a phone number as main. There can only be one phone
number marked as main at all times. Is there something for this?
Thanks for your help.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
2006 Apr 12
1
acts_as_list problem with records coming in and out
I have the model that acts as list
acts_as_list :scope => ''featured=1''
As you can see, I only need to order the records that are featured. However,
from time to time I switch some featured items off and mark others as
featured. When this is done, I start getting dublicate numbers on the list
and ordering starts getting problem...
What would be the good approach to
2007 May 22
3
can I use acts_as_list with a has_many :through association
I''d like to be able to use a has_many :through association and treat
the associations as a list but I''m getting this error when I try an
use an acts_as_list method:
NoMethodError: undefined method `move_to_bottom''
I''m using edge rails r6786.
Here are my domain rules:
Activities are things students can do.
Units consists of a sequenced list of
2010 Dec 22
8
Shoulda issue: no more "should have_instance_methods" ?
I''m using Shoulda.
After copying the code here....
.... http://joshuaclayton.github.com/code/2009/07/14/should-act-as-list.html....
into my test_helper file so I can test acts_as_list, I came across
issues. For one I realized I had to get rid of the _ between the
"should" and "have" in past cases, but here, I get this error when I
run my unit test:
2009 Jan 04
3
undefined local variable or method `acts_as_list'
So I seem to be having an issue with trying to install acts_as_list in
rails 2.2.2?
I have downloaded the files from: http://github.com/rails/acts_as_list/tree/master
I have put the files in the vendor/plugins folder the files are as
follows:
vendor/plugins/acts_as_list/init.rb
vendor/plugins/acts_as_list/lib/active_record/acts/list.rb
vendor/plugins/acts_as_list/test/list_test.rb
2006 May 26
6
Help needed with acts_as_list
Hi ! There must be something I don''t understand clearly in acts_as_list
I have a list of gallery entries (images + text), model is GalleryEntry.
I have a field in_exhibition (boolean)
I want the list to be sorted with a scope on in_exhibition : from 1 to N
for every record having in_exhibition = false and 1 to N for every
record having in_exhibition = true
When I use acts_as_list
2010 May 18
1
acts_as_list manual plugin install
Due to some corporate firewall difficulties I decided to go to my home
Mac and install the plugin in a rails project and then just copy the
plugin from the vendors/plugin folder to my (inside) corporate
project.
Is there a special registration that needs to take place somehow for
the plugin as rails doesn''t seem to recognize the method yet.
How do you run the "test" function
2006 Mar 22
10
Need for multiple acts_as_list
I have a model "Childmodel" that belongs_to two other models "Parent1"
and "Parent2". "Parent1" "has_many :childmodels, :order => :positionp1"
and "Parent2" "has_many :childmodels, :order => :positionp2". i.e. The
child is independently positioned within each of its parents.
This works fine and gets me the useful
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
2008 Feb 22
7
undefined local variable or method "acts_as_list"?
Hi, I''m getting the error below, and I''m not sure where to find
"acts_as_list" ...
NameError in SpecialsController#printer
undefined local variable or method `acts_as_list'' for #<Class:
0xb7a46994>
RAILS_ROOT: /usr/local/apache2/htdocs/dps
Application Trace | Framework Trace | Full Trace
vendor/plugins/trunk/lib/scope_out.rb:70:in
2009 Jan 05
3
Plugin not found: ["acts_as_list"]
I am trying to install acts_as_list in a rails 2.2.2 project but when I
try the following: ruby script/plugin install acts_as_list
I get: Plugin not found: ["acts_as_list"]
I had to download the acts_as_list plugin from the github because it
isn''t included in Rails 2.2.2.
The files are in my vendor/plugins/acts_as_list folder so I have:
lib/active_record/acts/list.rb
2005 Nov 25
2
acts_as_list with 2 fields in the scope
Hi Railers,
I''ve got a Categories table.
I want it to act as a list within the scope of the parent_id AND the
site_id.
Categories table :
id
label
site_id
parent_id
So, in my Category class, I have :
acts_as_list :scope => ''site_id = #{site_id} AND parent_id = #
{parent_id}''
The problem is that when I try to move_up a Category with a parent_id
that is null,
2010 Oct 13
2
acts_as_list issue in single table inheritence
Hello Rails experts,
Need your help in following issue with the acts_as_list and single
table inheritence
Code details :
http://pastie.org/1214846
Hello Rails experts,
Need your help in following issue with the acts_as_list and single
table inheritence
Code details :
http://pastie.org/1214846
But here I need create those entries with the scope on Relater only and
not on RelaterFeed or
2006 Sep 03
7
using polymorphic associations with acts_as_list
This is what I have
class Photo < ActiveRecord::Base
belongs_to :image, :polymorphic => true
acts_as_list :scope => image
end
class Place < ActiveRecord::Base
has_many :photos, :as => :image
end
class Child < ActiveRecord::Base
has_many :photos, :as => :image
end
I want to be able to reorder the images. What I need is for the
position of the photos to be set
2007 Jan 25
1
acts_as_tree with acts_as_list
Hello all,
I''m having trouble using acts_as_list with acts_as_tree
to order the "children". I''ve found a few old posts on the web
that seem to indicate that this once worked.
class Whatever < ActiveRecord::Base
acts_as_tree :order => :position
acts_as_list :scope => :parent_id
Although the ''position'' field is being populated,
it appears