search for: association_join

Displaying 6 results from an estimated 6 matches for "association_join".

2008 Nov 12
5
dynamic condition for has_one and eager loading issue
...JoinAssociation: 0x4d5bf5c>): C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/associations.rb:1621:in `interpolate_sql'' (eval):1:in `interpolate_sql'' C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/associations.rb:1600:in `association_join'' C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/associations.rb:1599:in `each'' C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/associations.rb:1599:in `association_join'' C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1...
2006 Jul 31
3
Polymorphic associations and single table inheritance
Running into an interesting problem that at first glance appears to be a bug in the AR association code. However, it''s explicitly coded this way so I''m not so sure. I have some code like this: class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end class Person < ActiveRecord::Base has_many :addresses, :as => :addressable,
2006 Jan 06
0
bug rails activerecord association join
...r or is it also a bug) Is there a better way of doing this? I wanna submit a patch but couldnt be sure if I did it correct. module ActiveRecord module Associations def self.append_features(base) super base.extend(ClassMethods) end module ClassMethods private def association_join(reflection) case reflection.macro when :has_and_belongs_to_many " LEFT OUTER JOIN #{reflection.options[:join_table]} ON " + "#{reflection.options[:join_table]}.#{reflection.options[:foreign_key] || to_s.foreign_key} = " +...
2006 Mar 16
1
Rails SQL generation (Firebird adapter) - can someone explain ...
I see some possible issues with the SQL that is being generated by the firebird adapter. Every SQL is being generated on the fly by concatenating strings. Can someone please explain why the SQL is being generated the way it is? I cannot use this in real life for a couple of reasons: 1. This introduces a security hole because a user, accidentally or deliberately, could potentially submit a
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 Jan 17
15
legacy database and finder_sql nightmare!
This is my first rails app with a legacy database and I''m having a terrible time getting the models set up correctly. I have an order table that has a primary field named order_number. I have a name table with a primary of item_number. These two tables are liked by the item_number and the order_number, but not as you might think. If the order_number is 2500, then each entry in