similar to: Self-Referencing Tables and Other DB Complexities

Displaying 20 results from an estimated 1000 matches similar to: "Self-Referencing Tables and Other DB Complexities"

2006 May 30
0
Single table lookups
I''m struggling with a single table type (self) lookup. my ''personnel'' model has a supervisor_id and is_supervisor column. The supervisor''s select list is created by @supv = Personnel.find(:all, :conditions => ["is_supervisor = true"], :order => ''last_name'') in my personnel model, I have the following... def
2006 Apr 09
1
Join using :THROUGH - SQL is wrong even when using :SOURCE
Here''s a join table for an educational institution: create_table "student_appointments", :force => true do |t| t.column "supervisor_id", :integer, :default => 0, :null => false t.column "student_id", :integer, :default => 0, :null => false t.column "course_id", :integer, :default => 0, :null => false [other columns
2012 Mar 21
1
Using extract function for dates in sqldf
I'm trying to use sqldf to query for the earliest date of a blood test when patients have had multiple tests in a given year. My query looks like this: test11 <- sqldf("select CHILD_ID, min(SAMP_DATE) from lab group by CHILD_ID having extract (year from SAMP_DATE) = 2011") SAMP_DATE has class "date." I get the error
2008 May 27
2
HABTM using two columns
Hi all, I was wondering whether anyone could guide me to docu and code examples how to create and use a has_and_belongs_to_many relationship with a joining table where TWO columns are used to identify the relation to TWO alternative tables. Example: table 1: mothers [mother_id, name] table 2: fathers [father_id, name] table 3: children [child_id, name] joining table 4: children_parent
2007 Feb 12
2
Objects in Arrays? Allowed, right?
Hi: I''m trying to manually append objects to an instance variable that is just an array of objects. Here''s my controller code: @tasks = Task.find(:all, :conditions => "entity_id = #{session[:user].id}") for t in @tasks if Subtasks.find(:first, :conditions => "child_id = #{t.id}") != nil @mtasks << t end end However, when I execute, I
2006 Apr 20
4
Many to Many Category structure with itself
Basically, I''m trying to have a table called "categories" have a many to many relationship with itself. But I also want each catagory to be able to be "copied" into another category so it is essentially a child category to more than one parent. To me the obvious way of doing this is by creating another table called category_maps (and a model called CategoryMap).
2006 May 07
1
Anyone care for a braindump?
I have this problem with records that have to be alligned on end- and startdate. I came up with the following. but am not convinced that this is the best way to tackle this problem. Anyone care for a braindump? def head_to_tail # Remove days that have startdate >= self.startdate AND enddate <= self.enddate # # before after # # |=====| |=====|
2007 Oct 22
1
self-referential habtm: why are my keys null?
I''m trying to set up a directional self-referential HABTM to represent an arbitrary semi-hierarchical structure; it works for any data prepopulated into the db, but when I try to create a new relationship, I just get NULLs in both key columns (or 0''s if I turn on the no-null constraint). Here are the migrations: class CreateNodes < ActiveRecord::Migration def self.up
2006 Jan 06
3
Flashing Window in Quicken
Wine version: all Linux version: Fedora 3 and Gentoo 2.6.14 Symptom: When running quicken, opening the "Split costs" dialog causes the program to go into an infinite loop, flashingthe window to proper size then minimized and back again, as fast as the display will allow. It appears that the window is opened and the program attempts to flash the caret but access is denied to
2008 Mar 28
0
Problems with URL encoding
Hi I have a problem when sending parameters from link_to_remote. My link code: <%= link_to_remote "Remove", :url => object_relation_path( :id => 0, :object_relation => { :parent_id => @product.id, :parent_type => "Product", :child_id => content_object.id, :child_type => "ContentObject",
2012 Nov 12
2
Root cannot delete files through samba share
Dear, We are integrating Samba with Active Directory in the company. The goal is to provide a samba share to users of AD. In this case, we need all users to write on the share, but nobody modify or delete any files. Even the user who owns it. With this, we would create only one AD user, if necessary with root powers, which could erase everything. For this, we test several lines, such as
2009 Mar 31
1
USING MULTILEVEL PACKAGE AND WABA FUNCTION
Dear friends, this time I have a problem with using waba function. Firstly, I'll explain you my situation. In the survey a gruop of supervisors judge the dipendents of a company. One supervisor reported on more than one subordinate. Thus, I need to show that lack of independence is not a problem, and a reviewer told me to use WABA. The question is, how? In which way i can build my X and Y?
2007 Jan 02
3
connecting asterisk (trixbox) to traditional phone lines?
Ok, I have trixbox working how I want. How do I now (cheaply as possibly) get a phone number so people can call it from any number? I am just doing a prototype so just want it done cheaply so I can demo it to my supervisors. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL:
2005 Mar 08
1
To convert an adjacency list model into a nested set model
Dear R-help I am wondering if somebody wrote some code to convert an adjacency list model into a nested set model. In principal I want to do the same as John Celko mentioned it here with SQL: http://groups.google.co.uk/groups?hl=en&lr=lang_en&selm=8j0n05%24n31%241 %40nnrp1.deja.com Assume you have a tree structure like this Albert / \ /
2004 May 19
2
CallCenter setup
Hi, I am investigating possibility of using asterisk as an call center controller, i.e. Clients phone in, interact with IVR, if IVR is not enough get redirected to human consultant. There should be possibility for supervisors to connect to ongoing conversation. Expected traffic will not exceed 30 concurrent calls. Asterisk box should be connected to Siemens "communication platform"
2006 Jul 13
1
How to create a child from a parent
Hi i am trying to figure out what is the best way to do this very basic thing: lets say i have two tables: one with parents and one with children. there is a one to many relation between them. I scaffolded the parents tabel and i can open each parent. Now i want to add a link to the ''show'' view which will create a new child record. In the model i defined the has_many and
2009 Sep 29
3
chanspy and DISA
Hello all, OS OpenSuSE 10.3 * ver 1.4.26.2 zaptel ver. 1.12 Digium TE122 I have a request for remote users to be able to dial through the system so that the sales managers can barge/chanspy on the sales force. I have the DISA part working with authentication(rather straight forward) but what I can not figure out is how to enable the supervisors to be able to barge on these calls. Is there a
2006 Aug 15
0
has_many relationships and minimums
Hi, New to Rails and the list. Quick questions regarding has_many relationships that require at least 1 child. I''m aware of validate_size_of and use this to make sure that the parent is not saved without at least one child. Question is, is there some Rails magic to help when removing children to ensure the last one is not removed? Currently I''m calling something like this in my
2006 Mar 08
0
acts_as_tree circular reference
my application is using acts_as_tree to create a directed graph. Everyone would work fine, except that nothing prevents the user to create a circular reference: >> item.parent=child >> item.save => true >> child.parent=item >> child.save => true I checked in the database, and there it is: an item that has as parent its own child! item.parent_id = child_id I
2006 Dec 22
3
Lumping vs. Splitting (REST)
Hi Everyone, Working on a REST-based web application, and I need some ammo in dealing with my supervisors and contractors. Is it better to: Method 1: Take in one large XML-based POST request, which contains 1st, 2nd and 3rd level elements, and build the associated child and grandchild objects in the parent controller, Method 2: Instead use a number of smaller XML-based POST requests