similar to: acts_as_list not CASCADE''ing in singular n-tier model structure

Displaying 20 results from an estimated 2000 matches similar to: "acts_as_list not CASCADE''ing in singular n-tier model structure"

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 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
2011 Sep 14
1
rspec and should have_many through
Hi, Anyone can help me with rspec shoulda validations please. I can''t get the syntax right for these validations. Please correct me it { should have_one :tradable, :through => :trade_order} it { should belong_to :source, :polymorphic => true } it { should have_many :transfers, :as => :source } this is for Rspec 2, rails 3.1, gem "rspec-rails" gem
2007 Aug 10
0
ActiveRecordAssociationMatcher
I''ve started to put together a custom expectation matcher for specifying AR associations. Its not quite complete and I really need to put some specs together for it, but I''d appreciate any comments. It lets you spec your associations like this: describe Record do include ActiveRecordAssociationMatchers it "should belong to artist and use a counter cache" do
2006 Mar 21
2
Sorting by computed temporary field
Hey all, I''m rather new to Ruby and Rails (and not great with SQL), but I''m developing a ride sharing app and would like to be able to sort on something I don''t have stored. I have users, events, and rides, each of which has a zip code. Events have_many rides, and rides belong_to events. When an event is selected, I''d like to be able to show a list of
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
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
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,
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 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 Jul 31
0
acts_as_list with single table inheritance
I have a question about where to decorate my classes with acts_as_list. I am using single table inheritance and i have a base class LookupItem. There are 5 child classes: Priority, Probability, RiskRating, Status, and RiskManagementItem. Each of these 5 items needs to act as a list. Should I use acts_as_list on each child class or should it go on the parent LookupItem class? I''m
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
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