Is :finder_sql using #{id} broken?

Hi All,

It seems that :finder_sql in a HABTM association only interprets a
single quoted #{id} the first time through a query. I see examples
of this being used in a few places (though with has_many) and I don’t
really see how to use :finder_sql without a #{id}.

Am I missing something or is this just broken?

Hi All,

On 8/13/06, Paul H. [email protected] wrote:

Am I missing something or is this just broken?
Well it strikes me as broken. I put the below bits in my app which
should fix this class of issue. Its unfortunately a sledge hammer
approach and not very pretty from an OO standpoint, but it does work.


Paul H. ([email protected] [email protected])

module ActiveRecord
module Associations
class AssociationProxy

  def initialize(owner, reflection)
    @owner, @reflection = owner, 

Marshal::load(Marshal.dump(reflection))
proxy_extend(reflection.options[:extend]) if
reflection.options[:extend]
reset
end

end

end
end