Displaying 20 results from an estimated 5197 matches for "relationships".
Did you mean:
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 assig...
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,
)
--- relations ---
f = friend
r = 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
...ntial 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 => "person_id"
belongs_to :contact, :foreign_key => "contact_id"...
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 relationshi...
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 Relatio...
2006 May 16
4
Problems with multiple ''id'' columns in a join_table
...tiveRecord 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 table, with id, name, and a few things.
Also a Relationships table, with id, subject, role, object.
subject and object are foreign keys into People.
The model declaration for ''person'' says :-
class Person < ActiveRecord::Base
has_and_belongs_to_many :parents, :class_name=>"Person",
:join_table=>&...
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 ot...
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 like:
CREATE TABLE `locations` (
id INT U...
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 :us...
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 ch...
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",
req...
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,
2006 Feb 10
4
Handling a relationship between users and newsletter subcriptions.
Hey Everyone!
I have a newsletter system that contains a multitude of different
newsletters. In this case three but the system allows the user to
add more. Every user can be subscribed to 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,
2015 Aug 24
2
[Samba4] 4.3.0 trust relationship
...rom Windows clients? Ex: user at a.domain.tld connecting on
computer at b.domain.tld
- are ldapsearch queries supposed to work when asking to dc.a.domain.tld
some information about object contained in b.domain.tld?
Or was I just to enthusiast?
Is there already some document related to these trust relationships
somewhere else than "samba-tool domain trust --help"?
Best regards,
mathias
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 R...
2008 Jan 01
3
Specify a correct formula in R for Piecewise Linear Functions?
...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),family = binomial, data = point) something like
this?
Thanks a lot.
--
With Kind Regards,
oooO:::::::::
(..):::::::::
:\.(:::Oooo::
::\_)::(..)::
:::::::)./:::
::::::(_/::::
:::::::::::::
[**********************************************************...