Displaying 20 results from an estimated 3000 matches similar to: "acts_as_list with single table inheritance"
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
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
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 Jan 15
2
acts_as_tree & acts_as_list for a single model?
Hi,
If I have a db table
categories
- id
- name
- parent_id
- position
is it alright to have the Category model act_as_tree and for each
level act_as_list?
class Category < ActiveRecord::Base
acts_as_tree :order => :position
acts_as_list :scope => :parent_id
end
Thanks,
Peter
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
2009 May 09
0
acts_as_list not working despite being installed
I just installed a newer version of Ubuntu and so with it, rails
2.3.2. Now I can''t get acts_as_list working. I get the error:
undefined method `acts_as_list'' for Child(Table doesn''t exist):Class
But I have already run
> ruby script/plugin install acts_as_list
+ ./README
+ ./init.rb
+ ./lib/active_record/acts/list.rb
+ ./test/list_test.rb
I started a new program
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
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
2006 Jun 11
0
Reaching through a belongs_to for acts_as_list scope?
I''m running into a situation where I''d like to provide the list scope
for an acts_as_list model from one step removed. In minimalistic form
(with several other associations removed from each level).
class MainEntity < AcrtiveRecord::Base
has_many :containers
end
class Container < ActiveRecord::Base
has_many :elements
belongs_to :main_entity
end
class
2006 Apr 20
0
acts_as_list not CASCADE''ing in singular n-tier model structure
[using RAILs 1.1.2]
Has anyone else seen issues where multiple tiered "acts_as_list"
models do not CASCADE delete correctly? For instance, I have 4
models, the first 3 in the hierarchy have the appropriate "have_many"
declarations with "exclusively_dependent => true". The last the
models have the appropriate "acts_as_list" with the correct scope
2009 Feb 12
0
acts_as_list sort by multiple items
I have a Person model and I''m using acts_as_list so I can have drag/drop
positioning of people. The only thing is, I want to be able to
differentiate between male and female, ie. sort males separately from
females. It seems completely useless to have two separate models since
all the other attributes of a person are the same (name, address etc)
Does acts_as_list allow ordering by, say,
2007 Mar 28
1
acts_as_list nested scope
Here''s what I''m trying to do:
class Model < AR::Base
acts_as_list :scope => [:key_one_id, :key_two_id, :key_three_id]
end
with the idea being that there are these three references from this table
(one of them being optional) that define the list. I don''t think acts as
nested set works in this situation because I''m still just dealing with a
single list
2005 Jul 07
2
0.13 ajax sortable lists and acts_as_list
I''m trying to figure out a good way to get acts_as_list and the new
sortable lists to play nicely together, but they don''t seem like
they''re designed to mesh well. The ajax sortable lists post a
complete ordered list of ids back to the server after every change,
but acts_as_list is designed to deal with diff-like changes, rather
than reordering the whole list from
2006 Apr 01
3
acts_as_list with scope : position update problem?
Hello,
I''ve tried to set up a class with acts_as_list with a scope argument
that restricts a list to records with the same foreign key.
For example :
database :
CREATE TABLE `families` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '''',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
INSERT INTO
2006 Jun 27
2
how to use scope with acts_as_list
i am working on a task management system for the company i work for. i
just got the rails cookbook and am trying to use the section on creating
a drag and drop sortable list.
the tricky part is that my Task model references the User model in two
different spots. i have one field for the creator of the task and
another for the assignee. so in my Task model i have the following code:
class
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
2006 Apr 21
0
acts_as_list with the scope on boolean field
I have a boolean field in mysql (tinyint) which I want to use as a
scope restriction for acts_as_list
acts_as_list :scope => ''featured = #{featured}''
however, there is a problem here as when Rails generates SQL query for
this it supplements true/false for #{featured} which raises error in
mysql
As a workaround I created dummy attributes that return 1/0 depending
on featured
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
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
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