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.

This project is archived and is in readonly mode.

ARel 1.9.2 compatibility

#3381
  1. Array#to_s in 1.9.2 changed to more :inspect-like,
--- a/lib/arel/engines/sql/relations/relation.rb
+++ b/lib/arel/engines/sql/relations/relation.rb 
@@ -12,7 +12,7 @@
         order = order.zip((0...order.size).to_a).map { |s,i| "id_list.alias_#{i} #{'DESC' if s =~ /\bdesc$/i}" }.join(', ')

         query = build_query \
-          "SELECT     #{select_clauses.to_s}",
+          "SELECT     #{select_clauses.kind_of?(::Array) ? select_clauses.join("") : select_clauses.to_s}",
           "FROM       #{table_sql(Sql::TableReference.new(self))}",
           (joins(self)                                   unless joins(self).blank? ),
           ("WHERE     #{where_clauses.join("\n\tAND ")}" unless wheres.blank?      ),
  1. Some methods aren't delegated, as instance_methods() returns array of symbols:
--- a/activerecord/lib/active_record/relation.rb
+++ b/activerecord/lib/active_record/relation.rb
@@ -110,7 +110,7 @@ module ActiveRecord
     end

     def respond_to?(method)
-      if @relation.respond_to?(method) || Array.instance_methods.include?(method.to_s)
+      if @relation.respond_to?(method) || [].respond_to?(method)
         true
       else
         super
@@ -121,7 +121,7 @@ module ActiveRecord
       def method_missing(method, *args, &block)
         if @relation.respond_to?(method)
           @relation.send(method, *args, &block)
-        elsif Array.instance_methods.include?(method.to_s)
+        elsif [].respond_to?(method)
           to_a.send(method, *args, &block)
         end
       end

Reported by Nikolai Lugovoi · October 15th, 2009 @ 09:36 PM

State: resolved
Milestone: 3.0.2
Assigned to: nobody
Importance: none

Activity

  1. Jeremy Kemper
    Jeremy Kemper
    • State changed from new to open
    • Milestone cleared.

    November 10th, 2009 @ 01:18 PM

  2. Jeremy Kemper
    Jeremy Kemper
    • State changed from open to resolved

    November 10th, 2009 @ 08:00 PM

  3. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 3.0.2
    • Importance changed from to

    October 15th, 2010 @ 11:01 PM