Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

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

#13

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

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

State: new
Milestone: none
Assigned to: nobody

Activity

  1. clyfe
    clyfe

    this is for active-record-2.3.2

    August 17th, 2009 @ 12:30 PM

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.