Displaying 20 results from an estimated 2000 matches similar to: "self referential habtm using join tables"
2006 Feb 27
0
self-referential many-to-many using a join model
Hello!
I have been working on making a self-referential habtm relationship
that uses a join model because I want to store info about the
relationship. I have been using two sections from Chad Fowler''s "Rails
Recipes" as a guide, "Self-referential Many-to-Many Relationships" and
"Many to Many Relationships Where the Relationship Itself has Data".
So far I
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 Feb 21
7
Self-referencial habtm relationship
Heyo!
I am setting up a self-referencial habtm relationship with the users
of my app. I am using Chad Fowler''s "Rails Recipes" to get me started,
and everything works great with the join table "people_friends". I add
friends by doing somebody.friends << somebodyelse. However, with my
app, there is an approval process so my join table has columns
person_id,
2007 Jul 26
1
Bi-directional self-referential HABTM
Hi,
I''m having a little trouble figuring out how to make a self-
referential HABTM bi-directional.
I have a Employee class. Each employee can have a couple of bosses,
who are also employees. The employee class has the following HABTM:
has_and_belongs_to_many :bosses, :class_name =>
"Employee", :join_table => "bosses_courses", :association_foreign_key
=>
2008 Jan 23
1
Self-referential HABTM SQL mal-formed when updating record
Guys,
Anyone ever had this kind of problem with ActiveScaffold?
Cheers, Sazima
------------------------------------------------------------------------------------------------
What steps will reproduce the problem?
1. Create self-referential HABTM application (like the common "user
has friends" example)
2. Try to add more than 1 friend to a given user using ActiveScaffold.
What is
2006 Feb 16
1
HABTM -VS- belongs_to/has_many, for self-referential joins
Ok, David says on page 241 that sometimes a many-to-many relation with
attributes are better implemented as an actual model instead of using HABTM.
Well, I''ve got that situation and I can''t figure it out.
All of the examples in the book have HABTM examples between 2 different
tables, but I want to have a HABTM relation on 1 table with itself. (e.g.,
if I have a table Things,
2006 Mar 05
1
Help with Self-Referential HABTM
With the help of the Rails Recipes have got a self-referential HABTM
relationship working, but I''m really struggling with getting a new entry
from a form accepted. i should say here that the form is also submitting
info for the join table too.
So in my model I have:
class Type < ActiveRecord::Base
has_and_belongs_to_many :subtypes,
:class_name => ''Type'',
2007 Jan 03
3
Self-referential habtm with condition is broken
Here''s a simplistic model class.
class Person < ActiveRecord::Base
has_and_belongs_to_many :relatives,
:class_name => ''Person'', :join_table => ''relatives'',
:foreign_key => ''from_id'', :association_foreign_key => ''to_id''
has_and_belongs_to_many :brothers,
:class_name =>
2008 Sep 26
0
self-referential tags, has_many_polymorphs
Hi,
I''m looking to add tagging to an application, and I would like to allow
self-referential tags, so that I can tag my tags. With the goal of
generating a flexible tag hierarchy.
After some googling it looks like acts_as_taggable is not the best piece
of code, and I''m hoping to use the has_many_polymorphs plugin from
http://github.com/fauna/has_many_polymorphs/tree/master.
2012 Oct 22
0
[LLVMdev] Self-referential instruction from jump threading
Hi Hal,
> After investigating PR14133, I've discovered that jump threading can output self-referential instructions:
> %inc.us = add nsw i32 %inc.us, 1
such instructions are valid in unreachable basic blocks.
> At least in the test case for that bug report, the relevant code is later deleted (perhaps it is unreachable), and so this does not cause a problem. Unfortunately, when
2012 Oct 22
0
[LLVMdev] Self-referential instruction from jump threading
Hal Finkel wrote:
> Hello,
>
> After investigating PR14133, I've discovered that jump threading can output self-referential instructions:
> %inc.us = add nsw i32 %inc.us, 1
>
> At least in the test case for that bug report, the relevant code is later deleted (perhaps it is unreachable), and so this does not cause a problem. Unfortunately, when vectorization is enabled, this
2006 Feb 23
2
lighttpd and blank page
Hi all:
I have been using lighttpd on os x with RoR. It normally works great,
however, when I use it for one project, kill the process, then switch
to another project and start up using ./script/server, all I get is a
blank page. No errors or html. The only solution I have found so far
is to restart my machine, but that seems terribly inneficient. How
does everybody else handle this, or do you
2006 May 29
2
foreign keys and referential integrity
Sans rails my normal approach to handling this would be to enforce it in
the database and when a database operation failed I''d try to validate
the model to produce an error message. It''s always served me pretty
well.
Rails expects you to validate before commiting but of course this does
nothing to guarantee referential integrity. It''s perfectly possible for
one
2006 Nov 29
4
how do I model self-referential entities?
Hi all -
I am having some trouble figuring out how to model self-referential
entities in Rails.
I have a "group" model, which can have 0 or more "group" objects or 0 or
more "user" objects.
I tried creating a subgroup table that has a parent_group_id and a
child_group_id as foreign keys but can''t figure out how to create the
mapping in my ruby model
2006 Jul 20
1
self referential xml using builder
Hi listers,
I''m trying to build an xml doc using Builder, but I''m having trouble
getting it to draw a tree structure from a self-referential table.
Here''s what I''m after:
==========================
---- object structure ----
node (name => root)
- node (name => child 1)
- node (name => child 2)
- node (name => child 2.1)
- node
2006 May 02
0
Self-referential MtoM implementation
ok, guys i have followed the self referential recipe from the book it
works perfect but now i have some doubts, at the end the model are
modified to force the user beign added as a friend that add too who are
adding him so how i can make that the full relationship doesn?t be
complete until the friend beign added approves it(talking in the
implementation of the code of course)?
by the way,
2006 Apr 17
0
Pros/cons of doubling up in Self-Referential has_many via :through
Relative newbie so would welcome comments re structure of a
self-referential relationship I''ve got.
It''s started off similar to the Person HABTM friends in the Rails
recipes books (working fine), but I needed to turn the join table into a
full-blown model as I wanted to add attributes to it. Few tricky bits
dealing with the new :through structure and understanding how :scope
2012 Jul 06
2
[LLVMdev] Self-referential function pointer
Hey guys,
I could use some advice on a special case of a function pointer as a formal
argument. I would like the function pointer type to contain the actual
signature of the function, i.e. not a pointer to var args function. This
becomes an issue when I have a function which can take a pointer to itself
as an argument... our terminology for this is "a recursive procedure". That
is, of
2006 Mar 25
0
Self-Referential Many-To-Many relationships where the relationship itself has data.
Trying to model a bunch of users that have friends that are other
users. clearly a job for has_and_belongs_to_many, but the trick is,
they have ratings for their friends. I have gone through the Rails
Recipes book, and it seems like I''m trying to combine the
self-referential many-to-many recipe (12) and the many to many
relationships where the relationship itself has data recipe (16). So
2012 Oct 22
4
[LLVMdev] Self-referential instruction from jump threading
Hello,
After investigating PR14133, I've discovered that jump threading can output self-referential instructions:
%inc.us = add nsw i32 %inc.us, 1
At least in the test case for that bug report, the relevant code is later deleted (perhaps it is unreachable), and so this does not cause a problem. Unfortunately, when vectorization is enabled, this instruction causes BBVectorize to hang. Should