Displaying 13 results from an estimated 13 matches for "child_ids".
Did you mean:
child_idx
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
#
# |=====| |=====|
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 May 09
2
what are all these methods?!?! :)
...tree in the console and I instantiated
a new tree object and went to use the readline support to see all the
available methods and I was rather surprised to see many many more
methods than I was expecting..so I went to the api site and a lot of
them weren''t documented.. .add_children, .child_ids, etc... now I can
guess pretty easily what these methods do and my next step is to go and
look at the source code...but can anyone suggest if i''m missing
something?
--
Posted via http://www.ruby-forum.com/.
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
2005 Jul 21
1
Self-Referencing Tables and Other DB Complexities
How well does Rails deal with ActiveRecord classes mapping to
self-referencing tables and other more interesting database
complexities?
i.e. Employees table with supervisor_id and mentor_id both
self-referencing Employees on the primary key "id"
or Categories table with relation table (Parent_Child_Categories) with
foreign keys parent_id and child_id both referencing Categories.id
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",
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 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 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
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