search for: relationship

Displaying 20 results from an estimated 5177 matches for "relationship".

2005 Apr 27
4
has_many syntax
Hi all, I have the following inside of an AR class definition: relationships=ActiveRecord::Base.connection.select_all(my_relationships_sql) relationships.each do |relationship| has_many RelatedItems, :class_name => relationship[''RelatedClass''], :foreign_key => relationship[''ForeignKey''] end This kind of works, but how can I assi...
2011 Jan 15
3
has_many :through with Single Table inheritance
I have the following model structure setup. class User < ActiveRecord::Base end class Parent < User has_many :relationships has_many :children, :class_name => "Student", :through => :relationships, :conditions => "related_as = ''parent''" end class Student < User has_many :relationships has_many :parents,...
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, ) --- re...
2006 Jan 19
1
Relationships, relationships, relationships!
If I had my very own sweaty, wind-up Ballmer (http://www.ntk.net/ballmer/mirrors.html warning: mind-scarring video), that is what he would be saying: "Relationships, relationships, relationships!!" My unscientific polling of the traffic in #rubyonrails and here is that, second to deployment issues, this is the bigges FAQ for Rails: how to do relationship x in ActiveRecord. There seems to be a lack of definitive and clear documentation for how to handle...
2005 Mar 24
5
Using html_options with link_to_remote??
Why doesn''t this output class="delete" into my html? <%= link_to_remote image_tag("delete"), :update => "relationship_" + @relationship.id.to_s, :url => { :controller => "relationships", :action => "destroy", :id => @relationship.id }, :html_options => {:class => "delete"} %> Regards, Ben
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 has_many :relationship has_many :contacts, :through => :relationship end end class Relationship < ActiveRecord::Base belongs_to :person, :foreign_key => "pers...
2006 Feb 26
3
Representing relationships between model objects
I''m a little stumped on how to approach the subject of representing relationships between a single model object. Basically, I want a User to be able to mark others as Friends, Contacts, etc. The caveat is that User A can mark User B as a Friend but that doesn''t mean User A is marked as a friend by User B. It can either be a one-way relationship or two-way relationsh...
2012 Feb 18
0
Rails NameError : uninitialized constant RelationshipsController
I am trying to run a test of my app buy my relationships_controller_spec.rb file won''t run. Here''s the error I get: Exception encountered: #<NameError: uninitialized constant RelationshipsController> Here''s the code for my relationships_controller_spec.rb file: require ''spec_helper'' describe Relati...
2006 May 16
4
Problems with multiple ''id'' columns in a join_table
I have a problem declaring a relationship through a join_table ; the SQL generated by ActiveRecord is correct, but there are two columns called ''id'', and the final object gets the ''wrong'' column ... Here''s a more detailed description of the data, code, and problem :- There''s a People...
2012 Aug 07
2
Passing arguments to a function within a function ...
Hallo Everybody How do you specify arguments for a function used within another function? Here is my problem: I am reconstructing a calculator for the burden of disease due to air pollution from publications and tools published by the WHO. The calculations make use of published dose-response relationships for particular health end-points. This is then applied to populations with known or estimated levels of exposure and incidence rates to calcute the number of cases of each end-point attributable to each pollutant. I have functions that work on their own but when is have to use the one within the o...
2006 Aug 02
2
many-to-one relationship, do I need a second table?
Ok, to keep things short. Im wondering if I need a secondary relationship table to handle my many-to-one relationships. Here is an example of what I''ve written down. For instance say I want to find all of the people in a given location. class Location < AR:Base has_many :people end class Person < AR:Base belongs_to :location end My SQL tables look...
2001 May 07
3
Samba 2.2.x and Trust Relationships?
Hi, Is it true that Samba 2.2.x PDC does not support trust relationships to other Windoze NT PDCs? Thanks in advance for your reply. Regards, Bernd Nies -- _ _ ___ ___ | || / __| _ \ Bernd Nies, System Engineer | __ \__ \ / HSR Hochschule, Oberseestr.10, CH-8640 Rapperswil |_||_|___/_|_\ +41-55-2224984, http://www.id.hsr.ch/ bnies@hsr.ch
2006 Jul 03
0
Modelling Relationships as objects
DHH in Rails Confeerence pointed out that abstract relationships should be converted into concrete objects, CRUDying up relationships. An example would be class User < ActiveRecord::Base has_many :subscriptions has_many :news_categories, :through => :subscriptions end class NewsCategory < ActiveRecord::Base has_many :subscriptions has_many :u...
2006 Feb 13
4
Table Relationships and ActiveRecord Associations
..., baring all that in mind, here are my questions with a bit of background information: We have a table for characters. They can have items (weapons, armor, etc), skills, spells and other things, like languages. They each have a class and race. My question is about how to set up the different relationships between these tables. Are there any good, in depth tutorials (with extensive examples) on how to set up relationships between tables? For instance, I know that the relationship between a character and its class would be: belongs_to, has_many But how would I set up the relationship between c...
2008 Jan 14
3
Spot the cyclical relationship
I got the following error, but there''s no "cycle" I commented out File["/dev/sdb3"] and it works, but of course would choke if I ran it and the requirement were not met err: Could not apply complete catalog: Found cycles in the following relationships: File[/dev/sdb1] => Exec[echo -e "0,290\n,290\n," | sfdisk /dev/sdb] Here''s the node: node testing { package { "iscsi-initiator-utils": provider => rpm, source => "/tmp/iscsi-initiator-utils-4.0.3.0-4.x86_64.rpm", re...
2011 Sep 13
6
Force regression line to a 1:1 relationship
Hello, I appreciate this is likely to be an easy question. I am trying to obtain the residuals from a linear regression where the line is forced to have a 1:1 relationship. An example of the data: A<-c(0.9803922, 1.3850416, 0.8241758, 0.0000000, 0.4672897, 1.1904762, 0.0000000, 0.9456265, 1.5151515) B<-c(1.3229572, 1.9471488, 1.3182674, 0.7007708, 1.0185740, 1.0268562, 0.8695652, 0.3016591, 1.9667171) plot(A, B, ylim=c(0,2), xlim=c(0,2)) abline(0,1, col=&qu...
2006 Feb 10
4
Handling a relationship between users and newsletter subcriptions.
...any amount of given newsletters. So what I did was I created a user model, newsletter model, and subscription model. The subscription model belongs to one user and one newsletter. However, I''m not quite sure what to do after that. Is this the proper way to perform this type of relationship or is it something where I would give the newsletter model a has_and_belongs_to_many users relationship? I''m not quite sure how to go about it. Any advice? Thanks! ---------------------------------------- Jim Jeffers "A trustworthy individual." www.DontTrustThisGuy.com (4...
2015 Aug 24
2
[Samba4] 4.3.0 trust relationship
Hi all, I was testing the 4.3.0 version to see what is available with trust relationship but except having my DCs telling me there are trust relationship and using the global catalog to perform search (but with only search for object in a.domain.tld when search is performed against dc.a.domain.tld) I can do nothing else. My own knowledge on that subject is quiet null so I come to you...
2007 Feb 21
4
Scaffolding plugins that support relationships. . .?
Hi All, I''m looking for a quality scaffolding plugin. So far I''ve discovered DryScaffolding and Streamlined. DryScaffolding doesn''t truly support Rails 1.2.2 so I dropped that. Streamlined works, but is full of quirks (e.g. many-to-many relationships not cascade updating correctly, etc). Can anyone suggest a quality scaffolding plugin/ generator/framework that supports relationships? Thanks, Michael --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on...
2008 Jan 01
3
Specify a correct formula in R for Piecewise Linear Functions?
Dear all, I have two variables, y and x. It seems that the relationship between them is Piecewise Linear Functions. The cutpoint is 20. That is, when x<20, there is a linear relationship between y and x; while x>=20, there is another different linear relationship between them. How can i specify their relationships in R correctly? # glm(y~I(x<20)+I(x>=20),fa...