similar to: acts_as_list issue in single table inheritence

Displaying 20 results from an estimated 100 matches similar to: "acts_as_list issue in single table inheritence"

2006 Apr 12
2
unit testing with model inheritence
Having jotted down some models, with some inheritence I tried to run some unit tests. After waiting for rake test_units to run I got a rake of errors (if you''ll forgive the play on words). The errors were to do with unknown tables in the tear down stage. The unknown tables corresponded to sub-types where single table inheritence was used. In other words, these tables *shouldn''t*
2005 Dec 12
0
Is this a good use for Single Table Inheritence?
Hi everyone, Where I work, there are several standards (heh) for position codes for staff and faculty. For instance, a Dean could be listed as DEA or DEN. An Assistant Professor could be AST or ASO. There are some cases where typos have crepts into the system, and AS0 (zero) could have meant ASO. Now, beyond getting those responsible to clean up their data (we are), I need to deal with this
2008 Feb 29
1
inheritence in S4
Hi the list I define a class A (slot a and b), a class C (slot c and d) and a class E that inherit from A and B. I define print(A) and print(B). For print(C), I would like to use both of them, but I do not see how... Thanks for your help... Christophe ---------------------------------------------------------------- Ce message a ete envoye par IMP, grace a l'Universite Paris 10 Nanterre
2007 Nov 23
1
what''s the best way to deal with class/inheritence
sorry to cross post to dev/users. -dev was not the best option ;-) Hi to all puppet masters: functionnality I need is quite simple: classes/ one .pp file per class, example: class mail-gateway { ...service/host/templates... definitions } -> this should set all that''s needed to setup a given system "rĂ´le" in the system (installing packages, config files with variables
2012 Jul 24
3
Adding resource parameters in inheritence
Hello, On some machines being managed by Puppet I would like to perform targetted audit runs with "puppet -t --noop --tags audit" For better or for worse I am trying to do this with a separate module "audit" rather than add the audit => to the resources and use inheritence. i.e. class audit::resolver inherits resolver::config { notify{"Running audit on
2006 Jul 11
0
using acts_as_list storing the information in a session
Hi, I have an order model that i am storing in a session, that is not currently in the database. I am updating the page using ajax, and I do not want to store the order in the database untill it is completely 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
2006 Jul 18
0
Bug in acts_as_list?
I''m using UUIDs as keys into my database (stored as CHAR(36)), and additionally have a model that is set to act as a list. In this scenario, I believe that the queries that Acts::List generate are invalid, caused by IDs being strings rather than integers. System info: Rails: 1.1.4 MySQL: 4.0.26 This is the failing query: mysql> SELECT * FROM children WHERE (parent_id =
2006 Jul 23
2
REST controller with up and down for model that acts_as_list
Hi, I have the following models class Department < ActiveRecord::Base has_many :products end class Product < ActiveRecord::Base belongs_to :department acts_as_list :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
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 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 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 May 24
0
acts_as_list with scope for two fields without parent/child
Hello, I''ve a model which doesn''t rely on parent/child relationship (it''s a list of news articles) Each article has a lang char(2) which identify the language of the article, and a art_type char (2) which identify the place the article must be displayed (in the shop (SH), or in the website (WE)) So, the news articles order should be scoped on lang + art_type but I
2006 May 30
2
acts_as_tree, acts_as_list and is invincible (help!)
So I have the following model class Topic < ActiveRecord::Base belongs_to :topic has_many :topics, :order => :position acts_as_tree :order => :position acts_as_list :scope => :topic_id end that I use for a site''s navigation. Everything (list, create, edit, even the drag&drop sort) works fine, except the destroy function, which the vanilla version def destroy
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
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
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 Jan 14
0
habtm with acts_as_list vs. :through
Hi, I am interested in has_and_belongs_to_many with an acts_as_list relationship where the position field is in the join table. I found the following tutorial http://wiki.rubyonrails.org/rails/pages/HowToUseActsAsListWithHasAndBelongsToMany Is there a newer way that is less complicated? What about the :through parameter that I read DHH is writing? Is that a reality yet? Thanks, Peter
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
2005 Dec 16
0
Join table with acts_as_list?
If anyone can point me in the right direction, I''d appreciate it. I thought I''d recently seen an example of a habtm relationship where the join table used an acts_as_list to keep the ordering of the relationship. Does anyone have a slick way of doing this in 1.0, or was it something in edge rails that I''m thinking of? (The new :through parameter maybe?)