similar to: best way to update one-to-many relationship

Displaying 20 results from an estimated 50000 matches similar to: "best way to update one-to-many relationship"

2006 Jul 31
2
updating records in a many-to-many relationship
Im trying to establish relationships in a many to many table. When I create a user, I do this to insert the different relationships between the user and sports: c.sports<<Sport.find_all_by_name(params[:sports]) where c is the user. The problem is, when I edit this user, and lets say he adds a sport, I can''t use this because I get an error saying that some records already
2006 Apr 24
9
Confusion with expressing many to many relationship
Hi folks, I am in the process of converting an existing non-rails application to rails, and am not sure what the best approach would be for specifying the relationship between the two sets of data. I''ll describe the existing table structures first. Table 1: Urls Each url has a unique id and two lists of Phrases, these are currently setup as varchars with "," delimitation -
2006 Jul 27
2
Saving records in mySQL for many-to-many relationship
Hey guys, Maybe someone could point out what wrong here. I''ve simplified the issue to this: Both User.find(6) and Sport.find(1) exist, Im just trying to setup the relationship between them. My controller looks like this def tester @c = User.find(6) @c.sports = Sport.find(1) end And I keep getting this error: undefined method `each'' for #<Sport:0x36a3488
2002 Aug 12
2
AIX authenticate()
Hi, I just got a comment from one of my IBM support engineeres that there is a problem with auth-passwd.c only calling authenticate() once. He claims it should potentially be called several times, in case several authetication methods are defined in /etc/security/user. F.ex.: SYSTEM = "NIS and DCE" Suggested (untested) patch should look like: ----------------- cut
2006 Jul 30
0
making friend request, many to many relationship
Hey I have a users table, what should I do to make a "friend request table". I cant have a table called users_users and have two columns, user_id and user_id. Whats the proper way of doing it in Ruby? -- Posted via http://www.ruby-forum.com/.
2006 Aug 02
1
Ordering the many in a many to one relationship
I have a many-to-one relationship between a model named Category(one) and a model named Brands (one). How can I get ActiveRecord to order the brands by the "name" attribute? This seems like a simple question and I can think of long ways around it but there has go to be a way to do this by accessing @category.brands . Can anyone help? I tried the code below in the controller but it
2006 Jul 29
1
creating and storing records in Ruby
I''ve read through my RoR books and I can''t seem to find the solution. This is a pretty basic, easy, and practical application for RoR. If you guys know of any resources on the net to answer these questions let me know. Question 1: Basically, I have a many-to-many relationship that I want to add records to. I use something like this to add records in the A_B table:
2001 Feb 22
1
Problem with OpenSSH 2.3.0p1/2.5.1p1 and AIX
We have come across a problem with OpenSSH 2.3.0p1 (and still in 2.5.1p1) which affect authentication on an AIX 4.3 system. The code in auth-passwd.c at line 168 reads: #ifdef WITH_AIXAUTHENTICATE return (authenticate(pw->pw_name,password,&reenter,&authmsg) == 0); #endif however, the AIX manual page for "authenticate" states: "The authenticate subroutine maintains
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
2006 Nov 04
0
one to many relationship; has_one
I''m new to ruby and rails and as a result am a bit lost on implementing a one to many relationship. In my DB I have 2 tables contents and locations, contents contains the foreign key location_id. I generated a content and a location model using rails scripts and then edited the models as follows class Content < ActiveRecord::Base has_one :location end class Location <
2006 May 22
0
(nebie) Autocomplete and many to one relationship?
All, I''m trying to get autocomplete to work for the first time. I''m not sure if I''m doing this right or not. I have a table where one of the fields is a employees name. I expect a relatively small collection of person''s names will be used. I created a simple employees table with just 2 fields: id, and name. Then in my main table I added a employee_id field
2008 Aug 29
3
Many to Many Relationship with One Model
Hey everyone, I''m working on allow users to follow other users in my app so they can receive updates to what all their friends are doing (like Facebook/ Twitter). I''m wondering on how the relationship would be for the model. Sounds like a HABTM type of association, but how would I go about doing it for only one model? Thanks, Tony
2006 Apr 02
1
One to Many Relationship Issues
Hi, I am having issues with a one to many relationship(it never works :-)). Jokes aside, I am getting an error: Mysql::Error: #23000Cannot add or update a child row: a foreign key constraint fails: INSERT INTO adverts (`image_url`, `price`, `title`, `website_url`, `description`, `user_id`) VALUES(''bb'', 22.0, ''aa'',
2003 Jun 05
0
One way trust relationship between Win2k and Samba 2. x.x PDC
I'm sure this has been discussed before, but would it then be possible to join a "real" NT4 or Win2k BDC to the Samba domain and establish the trust relation from our other Win2k? Or does the trust relationship have to be "registered" with the entire domain and therefore all the domain controllers? Khanh Tran Network Operations Sarah Lawrence College 1 Mead Way
2006 Oct 13
5
multi_search error undefined method
Hi, Im having problems using the multi_search command. I keep getting the following error. "undefined method `<<'' for Book:Class" here is the code associated with this. class Book < ActiveRecord::Base acts_as_ferret :store_class_name => true end class User < ActiveRecord::Base acts_as_ferret :store_class_name => true end and the call is the
2006 Jul 28
7
auto_complete_for exists but not being found by Rails
Anybody encounter this. I know the method exists in the auto_complete.rb file in my rails installation, but it itsnt accessing it throught he program. Any ideas? -- Posted via http://www.ruby-forum.com/.
2006 Jul 29
1
newbie - best place to put methods used in controllers?
Hey guys, Where is the best place to put methods called in your controller? I ask because my controller file is getting bulky with code that doesnt need to be called directly. I was wondering if I could put it in the application.rb or if there is some way to put it in the helper? -- Posted via http://www.ruby-forum.com/.
2006 Aug 02
3
newbie question, adding conditions to collection of sql objs
I have: @pictures=@c.pictures How do I add limit and order_by conditions. I have tried the following: @c.pictures.find_all(:limit=>5) @c.pictures, :limit=>5 @c.pictures :limit=>5 None of these work. -- Posted via http://www.ruby-forum.com/.
2009 Apr 23
2
Asterisk on Mac OS X
Hello list. I posted this over on the Biz section but some of the members thought I might find more people running Asterisk on the Mac over here. Here's my question: I have looked at PHLink and PhoneValet and neither seem to be able to do what I need, so I am looking at Asterisk. What I want to do is allow callers to call a our phone line and unsubscribe their phone number from our call
2012 Jan 19
2
[LLVMdev] Best way to interface with MSVC _ftol2 runtime function for fptoui?
On Jan 19, 2012, at 10:12 AM, Joe Groff wrote: > 2012/1/19 Jakob Stoklund Olesen <stoklund at 2pi.dk>: >> How many of these libcalls do you need to implement? What exactly is the calling convention? Which registers are clobbered etc. > > There is only one (that I know about so far). The MSVCRT `_ftol2` > function implements floating-point-to-unsigned conversion for i386