#13 new
clyfe

associations.rb select_limited_ids_list returns NULL becouse of PK instead of TBL.PK

Reported by clyfe | August 17th, 2009 @ 12:26 PM

CHANGE THIS in associations.rb

def select_limited_ids_list(options, join_dependency)

      pk = columns_hash[primary_key]

      connection.select_all(
        construct_finder_sql_for_association_limiting(options, join_dependency),
        "#{name} Load IDs For Limited Eager Loading"
      ).collect { |row| connection.quote(row[primary_key], pk) }.join(", ")
    end

TO THIS

def select_limited_ids_list(options, join_dependency)

      pk = columns_hash[primary_key]

      connection.select_all(
        construct_finder_sql_for_association_limiting(options, join_dependency),
        "#{name} Load IDs For Limited Eager Loading"
      ).collect { |row|
        value_to_quote = row[primary_key]
        if value_to_quote == nil
          value_to_quote = row[table_name + '.' + primary_key]
        end
        connection.quote(value_to_quote, pk)
      }.join(", ")
    end

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

ActiveRecord is an insanely easy to use database framework written in objective-c It's obviously "inspired" by (copying) the infamous ActiveRecord that comes with Rails(http://rubyonrails.org) But it tries to be more versatile when it comes to working with multiple connections.

People watching this ticket

Pages