similar to: using polymorphic associations with acts_as_list

Displaying 20 results from an estimated 1000 matches similar to: "using polymorphic associations with acts_as_list"

2010 Sep 08
2
subbing a string vector for another string vector
I have a data frame with two columns: image pattern 1 http://$IMAGE_ID$ www.url.com/image.jpg 2 $IMAGE_ID$ http://www.blah.com/image.gif ... I want to replace "$IMAGE_ID$" with the corresponding entry in the pattern column such that the result would appear as follows: url http://www.url.com/image.jpg
2006 May 21
3
acts_as_list scope and polymorphic association.
this is my model: class Person < ActiveRecord::Base has_many :phones, :as => :callable, :order => :position end class Phone < ActiveRecord::Base belongs_to :callable, :polymorphic => true acts_as_list :scope => :callable_id end how can i add the callable_type to the scope. how can i say the scope is the {:callable_id,:callable_type} couple? is it even possible? thanks
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
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
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
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
2006 Mar 20
1
FileColumn question
Can someone please help me with this. I have an Images table :- create table images ( id integer unsigned not null auto_increment primary key, image varchar(200) not null default '''' )ENGINE=InnoDB default CHARSET=latin1; And a car table :- create table cars ( id integer unsigned not null auto_increment primary key, user_id integer unsigned not null, title varchar(100) not
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
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
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/.
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
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 Sep 10
5
why isn't :order working in acts_as_list
Ok, I''m sure this has to be something stupid that I''m doing (or not doing), but I can''t seem to get things to order by the specified column. class List < ActiveRecord::Base has_many :list_items, :order => "orderby" The error I get back when trying to save the link is: Unknown column ''position'' in ''order clause'':
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 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
2007 Nov 14
1
has_many_polymorphs and acts_as_list ?
First, BRAVO for this wonderful plugin: has_many_polymorphs ! Now my problem: 4 models : Collection, Page, Fragment, Belonging (which is the join table): 1 class Collection < ActiveRecord::Base 2 has_many_polymorphs :elements, 3 :through => :belongings, 4 :from => [:pages, :fragments, :collections], 5 :as => :collector, 6 :parent_order =>
2010 Sep 09
4
acts_as_list query
When moving an item around within the list, shouldn''t EVERY item have its optimisitc locking field updated? Currently, only the item that is moved has its optimisitc locking field updated, but every item has its position field changed so surely they too should have their optimistic locking fields updated? I''ve created a drag and drop interface on a list of items that allows for