Displaying 20 results from an estimated 2000 matches similar to: "Naming confusion"
2006 Jan 19
4
Controller / Model confusion
I have created a product, with two controllers and two models, one for
categories and one for articles. In my models directory, I have
article.rb and articles.rb and seem to have code that relies on both of
these!
I am unable to get any validation working because of this (whichever
model I put the code in, it doesn''t load it)
Should I just rip it all apart and start again?
--
2006 Jan 05
2
Rails Newb: Foreign Key Views?
I''m a total rails newbie, but I''m learning fast. I have a question that
I can''t seem to find an answer for:
What is the best way of coding views that represent foreign key
relationships?
For example, while developing, I''ve created an "articles" table. I
create some scaffolding code and modify it all to look nice. I then
realise, I need an
2006 Aug 02
2
Self-Referential has_many :through
Hello all.
I am trying to create a self-referential has_many :through. I used the
following site as a guide
http://blog.hasmanythrough.com/articles/2006/04/21/self-referential-through
but it still doesn''t appear to be working. I have two models. Person and
Relationship. A person has many contacts (Which is another person)
through relationships
class Person < ActiveRecord::Base
2006 Mar 31
6
Adding objects to a :through association
So I''m one of those nasty people building a self-referential
habtm-like Association using the funky new :through stuff. This is
about users having friends, so here''s my user.rb:
class User < ActiveRecord::Base
has_many :friendships, :foreign_key => ''user_id''
has_many :friends, :through => :friendships, :source => :friend
end
And here''s
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
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
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
2006 Aug 15
2
How to access attribute in a self-referential many-to-many relationship
Hello List,
I created a self-referential many-to-many relationship (as described
in the book Rails recipe #18), where I have a model that has
many-to-many relationships with itself. In this case, it''s person who
can become friends. The join table looks like this:
mysql> select * from friends_people;
+-----------+-----------+-----------+
| person_id | friend_id | confirmed |
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
2019 Nov 18
2
BUG?: A copy of base::`+` (primitive) is not a clone but a "pointer"
On 11/18/19 10:45 AM, Martin Maechler wrote:
>>>>>> Tomas Kalibera
>>>>>> on Mon, 18 Nov 2019 09:36:14 +0100 writes:
> > On 11/18/19 9:18 AM, Martin Maechler wrote:
> >>>>>>> Henrik Bengtsson
> >>>>>>> on Sun, 17 Nov 2019 14:31:07 -0800 writes:
> >> > $ R --vanilla R
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.
2013 Jun 14
0
Support for deferrable constraints in PostgreSQLAdapter#disable_referential_integrity
I recently submitted a pull-request
(https://github.com/rails/rails/pull/10939) to address a bug in
PostgreSQLAdapter#disable_referential_integrity related to how the
existing code behaves in a transaction when the PostgreSQL user account
lacks superuser privileges on the PostgreSQL instance.
While this permits the code to function without crashing, it doesn''t
actually make
2015 Feb 24
3
[LLVMdev] Jump Theading/GVN bug - moving discussion to llvm-dev
On 24 February 2015 at 02:05, Chandler Carruth <chandlerc at google.com> wrote:
> Will try to reply to the larger thread again soon, but a quick reply on a
> bit of a tangent...
>
> On Mon, Feb 23, 2015 at 8:45 PM, Hal Finkel <hfinkel at anl.gov> wrote:
>>
>> 2. Should unreachable code be allowed to contain nonsense (like
>> instructions that depend on
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
=>
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'',
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 May 28
7
Self-referential has_many :through relationship
Hi,
I have a self-referential has_many :through relationship setup to
track relationships between users. Basically relationships are
modeled as a join table with an extra column ''relation''.
create table relationships (
user_id integer unsigned not null,
friend_id integer unsigned not null,
relation char(1) not null,
)
--- relations ---
f = friend
r = request to
2006 Mar 15
3
Self-referential join model does not work
I have been trying to model a labeled graph using ActiveRecord (trunk
version). Basically, I have a ''Node'' model which represents a node linking
to other nodes. Links (aka edges) are labeled (i.e., have a ''label''
attribute and other behavior). Thus I decided to model edges as an ''Edge''
model and use a ''has_many :trough''
2006 Aug 13
10
does rails enforce referential integrity???
Hi,
Is rails supposed to support referential integrity? That is rails
either support to be able to ensure that when a new contact is created
this can only happen if a valid suberb is associated with it, and which
mechanisms of the below are supposed to do this?
(a) using DB foreign key constraints information as a basis?
(b) using the "has_one" line in the model file to enfore?
If