similar to: Multiple associations between tables - do they ever work?

Displaying 20 results from an estimated 3000 matches similar to: "Multiple associations between tables - do they ever work?"

2006 Apr 11
6
Oracle unit test problem in Rails 1.1.2/Ruby-OCI 0.1.14
I''ve upgraded to Rails 1.1.2, and I''m trying to push this change through to our build server (Linux/Oracle) and we are getting some errors in the unit tests using Oracle. Looking at the data in the tests reveals a precision problem. Looking at the tables tells the whole story. My development database contains this table: SQL> describe dls_grids; Name
2006 Apr 20
4
oci8 mac os x intel
Is rails + oci8 + mac os x intel a winning combination? It appears that oci8 might be a issue.
2006 Jan 10
5
Select Tag and Associations
Hi there, I''ve been working on this for awhile and have finally decided to ask for a little guidance.I have a slight problem trying to save a selection. I have two models: A "Posting" has_many "Categories", and a "Category" belongs_to one "Posting". With that said, in the posting model I have "has_many :categories" and within the
2006 Jan 22
2
suggest for "ambiguous column" when JOIN associated tables
Today I face with incorrect behavior in ActiveRecord. It take place when I try to use :include parameter for .find method. Where are two typical cases: 1. You have record with self-referential joins CREATE TABLE keywords (id, group_id); class Keyword < ActiveRecord::Base belongs_to :group, :class_name => "Keyword", :foreign_key =>
2008 May 23
12
Modules will no longer be automatically included in RSpec version 1.1.4
Can anyone (David?) shed some light on what exactly this warning is complaining about? I started seeing it when I upgraded to Rails 2.1 RC1 and the latest RSpec from git. I''m getting it in some helper specs that I''m writing. And yes, I am including a module there, to reuse some utility methods I originally wrote for my controller tests (I''m switching to specs
2007 Jun 18
0
Problem with belongs_to associations validating associated class: bug in rails in development mode?
Hi all, I''m using rails version 1.2.3. I have the following association in my View class belongs_to :viewer, :class_name => ''User'', :foreign_key => :viewer_id And of course i have a User model class defined to. The problem was that when i tried to use this association it would only work once. At the second try, i would get the following strange error:
2006 Mar 18
9
RJS - not working in IE
I searched thru all the postings about RJS, and I didn''t find one person who complained of problems specific to IE, but that''s what I''ve got. My environment is: Rails 1.0 + RJS Plugin Updated Javascripts to Scriptaculous 1.5.3 (for evalScripts support) Monkeypatched in_place_editor to support evalScripts I have just started using RJS, and I have two .rjs templates.
2006 Feb 14
6
Multiple associations to the same class
Hi, I cannot seem to create associations like this: class Project < ActiveRecord::Base belongs_to :manager, :class_name => ''User'', :foreign_key => ''manager'' belongs_to :liaison, :class_name => ''User'', :foreign_key => ''liaison'' end p = Project.new p.manager => 1 trying to retrieve associated objects
2006 Mar 24
2
Change to has_many :through associations
Hi everyone. I''ve made a default change to has_many :through associations that I felt was important to make before they''re released. This is after some tickets and confusion I''ve seen regarding has_many :through. class Connection < ActiveRecord::Base belongs_to :user belongs_to :channel end class Channel < ActiveRecord::Base has_many :connections
2006 Sep 03
1
New Technique: Subsets of has_many Associations
I just now thought of this, and sure enough it works like a charm (at least so far in my limited testing): has_many :events, :dependent => :delete_all has_many :upcoming_events, :class_name => "Event", :conditions => "date > NOW()" The purpose of this is that it makes eager loading of subsets of associations possible without replacing all the magic of the
2009 Apr 16
0
Magic multi connections with association problem
Dear all I am using magic multi connections, there is some problem when using association. How can I dynamic determine the module name (i.e. A::Request, B::Request) in activerecord association. Below is my code: module A establish_connection :A end module B establish_connection :B end # and many module.... class Request < ActiveRecord::Base set_table_name "request"
2006 Jun 13
0
question about saving associations when using has_many :through
I''ve got a User model and a Book model. A user is required to submit books each month to be reviewed by other users. I have the following relationships defined: # the join model book_review.rb belongs_to :user belongs_to :book end book.rb # each book is reviewed by many users. This allows us to get the BookReview # objects associated with this book has_many :book_reviews,
2010 Nov 24
0
Surprise in (delete_all | clear | destroy_all) on association
Hi, I was very surprised by difference of delete_all on association vs model(delegated to relation). Given TaskFilter.has_many(:qualifiers, :class_name=>''TaskFilterQualifier'') TaskFilter.delete_all => one DELETE statement Without :dependent option on "qualifiers" association TaskFilter.first.qualifiers.delete_all => SELECT `task_filter_qualifiers`.* FROM
2006 Apr 12
0
Re: Re: Oracle unit test problem in Rails 1.1.2/Ruby-OCI 0.1
> -----Original Message----- > From: rails-bounces@lists.rubyonrails.org > [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Lori Olson > Sent: Tuesday, April 11, 2006 8:04 PM > To: rails@lists.rubyonrails.org > Subject: [Rails] Re: Re: Oracle unit test problem in Rails > 1.1.2/Ruby-OCI 0.1 > > > Wilson Bilkovich wrote: > > On 4/11/06, Lori Olson
2008 Jun 03
5
Autotest/RSpec 1.1.4/Rails 2.1 Infinite Loop?
I just got back from RailsConf, and upgraded on of my development apps to 2.1, and now autotest is going into an infinite loop. It runs tests continuously instead of waiting for files to be saved before rerunning. Has anybody else seen this, or know how to get around it? Thanks, Andrew
2006 Jan 06
0
bug rails activerecord association join
hi, I found a bug in ActiveRecord association SQL INNER JOIN codes. in has_many, has_one, habtm and belongs_to queries the foreign key is determined from the table name of reflection and self. but that''s worng because if you use a global prefix or suffix for your tables the foreign keys will be in format of PREFIX_CLASSNAME_SUFFIX_id which is wrong, because it breaks the advantage of
2006 Jan 31
4
Rails bug? Conditions on associations ignored by eager loading
I''m looking for someone to confirm the following as a bug in Rails 1.0 before I post it to Trac. If I use eager loading on an association that has conditions defined, the conditions are ignored. The following example illustrates the problem. I have two tables: create_table "blogs", :force => true do |t| t.column "name", :string end create_table
2006 Mar 15
1
Through method problems with custom foreign_keys
A person has a many company_branches and A company_branch has many people. This join is represented using a "contacts" table. I am using a legacy schema so i am forced into using non-standard rails primary keys. I am using the new through relationship in rails 1.1. p=Person.find(1) b=p.company_branches # gives this error: ActiveRecord::StatementInvalid: OCIError: ORA-00904:
2006 Mar 31
3
Complex Through Statement
Quick Overview: I have an ''Employee'', some ''Merchants'' and some ''Products''. A ''Merchant'' has many ''Products''. An ''Employee'' has multiple ''Merchants'', depending on their relationship. For example, the Employee may be the enrollment contact for one merchant and the
2009 Sep 01
5
Deep nested associations on the same Model
This could be a lot simpler than I think and I''m just missing something obvious! I''m working on a creative collaboration app whereby one user could submit a Story and this can then be forked by another user and worked on seperately. To acheive this I have a has_many association within the same Story model as such: class Story < ActiveRecord::Base has_many