Hello community,

here is the log from the commit of package rubygem-activerecord-5_1 for 
openSUSE:Factory checked in at 2019-04-01 12:36:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-activerecord-5_1 (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-activerecord-5_1.new.25356 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-activerecord-5_1"

Mon Apr  1 12:36:19 2019 rev:8 rq:689686 version:5.1.7

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/rubygem-activerecord-5_1/rubygem-activerecord-5_1.changes
        2019-03-27 16:21:53.487523662 +0100
+++ 
/work/SRC/openSUSE:Factory/.rubygem-activerecord-5_1.new.25356/rubygem-activerecord-5_1.changes
     2019-04-01 12:36:20.789855801 +0200
@@ -1,0 +2,22 @@
+Fri Mar 29 05:53:46 UTC 2019 - Stephan Kulow <co...@suse.com>
+
+- updated to version 5.1.7
+ see installed CHANGELOG.md
+
+  ## Rails 5.1.7 (March 27, 2019) ##
+  
+  *   Fix `touch` option to behave consistently with `Persistence#touch` 
method.
+  
+      *Ryuta Kamizono*
+  
+  *   Back port Rails 5.2 `reverse_order` Arel SQL literal fix.
+  
+      *Matt Jones*, *Brooke Kuhlmann*
+  
+  *   `becomes` should clear the mutation tracker which is created in 
`after_initialize`.
+  
+      Fixes #32867.
+  
+      *Ryuta Kamizono*
+
+-------------------------------------------------------------------

Old:
----
  activerecord-5.1.6.2.gem

New:
----
  activerecord-5.1.7.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-activerecord-5_1.spec ++++++
--- /var/tmp/diff_new_pack.jVvgi0/_old  2019-04-01 12:36:21.577856187 +0200
+++ /var/tmp/diff_new_pack.jVvgi0/_new  2019-04-01 12:36:21.581856189 +0200
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-activerecord-5_1
-Version:        5.1.6.2
+Version:        5.1.7
 Release:        0
 %define mod_name activerecord
 %define mod_full_name %{mod_name}-%{version}

++++++ activerecord-5.1.6.2.gem -> activerecord-5.1.7.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md    2019-03-13 17:45:26.000000000 +0100
+++ new/CHANGELOG.md    2019-03-28 03:46:04.000000000 +0100
@@ -1,3 +1,20 @@
+## Rails 5.1.7 (March 27, 2019) ##
+
+*   Fix `touch` option to behave consistently with `Persistence#touch` method.
+
+    *Ryuta Kamizono*
+
+*   Back port Rails 5.2 `reverse_order` Arel SQL literal fix.
+
+    *Matt Jones*, *Brooke Kuhlmann*
+
+*   `becomes` should clear the mutation tracker which is created in 
`after_initialize`.
+
+    Fixes #32867.
+
+    *Ryuta Kamizono*
+
+
 ## Rails 5.1.6.2 (March 11, 2019) ##
 
 *   No changes.
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/lib/active_record/associations/belongs_to_association.rb 
new/lib/active_record/associations/belongs_to_association.rb
--- old/lib/active_record/associations/belongs_to_association.rb        
2019-03-13 17:45:26.000000000 +0100
+++ new/lib/active_record/associations/belongs_to_association.rb        
2019-03-28 03:46:04.000000000 +0100
@@ -65,7 +65,7 @@
         def update_counters_on_replace(record)
           if require_counter_update? && different_target?(record)
             owner.instance_variable_set :@_after_replace_counter_called, true
-            record.increment!(reflection.counter_cache_column)
+            record.increment!(reflection.counter_cache_column, touch: 
reflection.options[:touch])
             decrement_counters
           end
         end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_record/associations/builder/belongs_to.rb 
new/lib/active_record/associations/builder/belongs_to.rb
--- old/lib/active_record/associations/builder/belongs_to.rb    2019-03-13 
17:45:26.000000000 +0100
+++ new/lib/active_record/associations/builder/belongs_to.rb    2019-03-28 
03:46:04.000000000 +0100
@@ -84,7 +84,8 @@
         else
           klass = association.klass
         end
-        old_record = klass.find_by(klass.primary_key => old_foreign_id)
+        primary_key = reflection.association_primary_key(klass)
+        old_record = klass.find_by(primary_key => old_foreign_id)
 
         if old_record
           if touch != true
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_record/attribute_methods/dirty.rb 
new/lib/active_record/attribute_methods/dirty.rb
--- old/lib/active_record/attribute_methods/dirty.rb    2019-03-13 
17:45:26.000000000 +0100
+++ new/lib/active_record/attribute_methods/dirty.rb    2019-03-28 
03:46:04.000000000 +0100
@@ -204,12 +204,12 @@
 
       # Alias for `changed`
       def changed_attribute_names_to_save
-        changes_to_save.keys
+        mutations_from_database.changed_attribute_names
       end
 
       # Alias for `changed_attributes`
       def attributes_in_database
-        changes_to_save.transform_values(&:first)
+        mutations_from_database.changed_values
       end
 
       def attribute_was(*)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_record/attribute_mutation_tracker.rb 
new/lib/active_record/attribute_mutation_tracker.rb
--- old/lib/active_record/attribute_mutation_tracker.rb 2019-03-13 
17:45:26.000000000 +0100
+++ new/lib/active_record/attribute_mutation_tracker.rb 2019-03-28 
03:46:04.000000000 +0100
@@ -8,6 +8,10 @@
       @deprecated_forced_changes = Set.new
     end
 
+    def changed_attribute_names
+      attr_names.select { |attr_name| changed?(attr_name) }
+    end
+
     def changed_values
       attr_names.each_with_object({}.with_indifferent_access) do |attr_name, 
result|
         if changed?(attr_name)
@@ -20,7 +24,7 @@
       attr_names.each_with_object({}.with_indifferent_access) do |attr_name, 
result|
         change = change_to_attribute(attr_name)
         if change
-          result[attr_name] = change
+          result.merge!(attr_name => change)
         end
       end
     end
@@ -82,6 +86,10 @@
   class NullMutationTracker # :nodoc:
     include Singleton
 
+    def changed_attribute_names(*)
+      []
+    end
+
     def changed_values(*)
       {}
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_record/callbacks.rb 
new/lib/active_record/callbacks.rb
--- old/lib/active_record/callbacks.rb  2019-03-13 17:45:26.000000000 +0100
+++ new/lib/active_record/callbacks.rb  2019-03-28 03:46:04.000000000 +0100
@@ -330,6 +330,10 @@
       _run_touch_callbacks { super }
     end
 
+    def increment!(attribute, by = 1, touch: nil) # :nodoc:
+      touch ? _run_touch_callbacks { super } : super
+    end
+
   private
 
     def create_or_update(*)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/lib/active_record/connection_adapters/abstract/connection_pool.rb 
new/lib/active_record/connection_adapters/abstract/connection_pool.rb
--- old/lib/active_record/connection_adapters/abstract/connection_pool.rb       
2019-03-13 17:45:27.000000000 +0100
+++ new/lib/active_record/connection_adapters/abstract/connection_pool.rb       
2019-03-28 03:46:04.000000000 +0100
@@ -191,7 +191,9 @@
             t0 = Time.now
             elapsed = 0
             loop do
-              @cond.wait(timeout - elapsed)
+              ActiveSupport::Dependencies.interlock.permit_concurrent_loads do
+                @cond.wait(timeout - elapsed)
+              end
 
               return remove if any?
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/lib/active_record/connection_adapters/abstract/quoting.rb 
new/lib/active_record/connection_adapters/abstract/quoting.rb
--- old/lib/active_record/connection_adapters/abstract/quoting.rb       
2019-03-13 17:45:27.000000000 +0100
+++ new/lib/active_record/connection_adapters/abstract/quoting.rb       
2019-03-28 03:46:04.000000000 +0100
@@ -152,6 +152,7 @@
       end
 
       def quoted_time(value) # :nodoc:
+        value = value.change(year: 2000, month: 1, day: 1)
         quoted_date(value).sub(/\A\d\d\d\d-\d\d-\d\d /, "")
       end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/lib/active_record/connection_adapters/abstract_mysql_adapter.rb 
new/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
--- old/lib/active_record/connection_adapters/abstract_mysql_adapter.rb 
2019-03-13 17:45:27.000000000 +0100
+++ new/lib/active_record/connection_adapters/abstract_mysql_adapter.rb 
2019-03-28 03:46:04.000000000 +0100
@@ -873,15 +873,25 @@
         end
 
         def mismatched_foreign_key(message)
-          parts = message.scan(/`(\w+)`[ $)]/).flatten
-          MismatchedForeignKey.new(
-            self,
+          match = %r/
+            (?:CREATE|ALTER)\s+TABLE\s*(?:`?\w+`?\.)?`?(?<table>\w+)`?.+?
+            FOREIGN\s+KEY\s*\(`?(?<foreign_key>\w+)`?\)\s*
+            
REFERENCES\s*(`?(?<target_table>\w+)`?)\s*\(`?(?<primary_key>\w+)`?\)
+          /xmi.match(message)
+
+          options = {
             message: message,
-            table: parts[0],
-            foreign_key: parts[1],
-            target_table: parts[2],
-            primary_key: parts[3],
-          )
+          }
+
+          if match
+            options[:table] = match[:table]
+            options[:foreign_key] = match[:foreign_key]
+            options[:target_table] = match[:target_table]
+            options[:primary_key] = match[:primary_key]
+            options[:primary_key_column] = column_for(match[:target_table], 
match[:primary_key])
+          end
+
+          MismatchedForeignKey.new(options)
         end
 
         def integer_to_sql(limit) # :nodoc:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/lib/active_record/connection_adapters/postgresql/oid/array.rb 
new/lib/active_record/connection_adapters/postgresql/oid/array.rb
--- old/lib/active_record/connection_adapters/postgresql/oid/array.rb   
2019-03-13 17:45:27.000000000 +0100
+++ new/lib/active_record/connection_adapters/postgresql/oid/array.rb   
2019-03-28 03:46:04.000000000 +0100
@@ -31,7 +31,13 @@
 
           def cast(value)
             if value.is_a?(::String)
-              value = @pg_decoder.decode(value)
+              value = begin
+                @pg_decoder.decode(value)
+              rescue TypeError
+                # malformed array string is treated as [], will raise in PG 
2.0 gem
+                # this keeps a consistent implementation
+                []
+              end
             end
             type_cast_array(value, :cast)
           end
@@ -64,6 +70,10 @@
             deserialize(raw_old_value) != new_value
           end
 
+          def force_equality?(value)
+            value.is_a?(::Array)
+          end
+
           private
 
             def type_cast_array(value, method)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/lib/active_record/connection_adapters/postgresql/oid/range.rb 
new/lib/active_record/connection_adapters/postgresql/oid/range.rb
--- old/lib/active_record/connection_adapters/postgresql/oid/range.rb   
2019-03-13 17:45:27.000000000 +0100
+++ new/lib/active_record/connection_adapters/postgresql/oid/range.rb   
2019-03-28 03:46:04.000000000 +0100
@@ -51,6 +51,10 @@
             ::Range.new(new_begin, new_end, value.exclude_end?)
           end
 
+          def force_equality?(value)
+            value.is_a?(::Range)
+          end
+
           private
 
             def type_cast_single(value)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/lib/active_record/connection_adapters/postgresql_adapter.rb 
new/lib/active_record/connection_adapters/postgresql_adapter.rb
--- old/lib/active_record/connection_adapters/postgresql_adapter.rb     
2019-03-13 17:45:27.000000000 +0100
+++ new/lib/active_record/connection_adapters/postgresql_adapter.rb     
2019-03-28 03:46:04.000000000 +0100
@@ -2,6 +2,14 @@
 gem "pg", ">= 0.18", "< 2.0"
 require "pg"
 
+# Use async_exec instead of exec_params on pg versions before 1.1
+class ::PG::Connection
+  unless self.public_method_defined?(:async_exec_params)
+    remove_method :exec_params
+    alias exec_params async_exec
+  end
+end
+
 require "active_record/connection_adapters/abstract_adapter"
 require "active_record/connection_adapters/statement_pool"
 require "active_record/connection_adapters/postgresql/column"
@@ -613,7 +621,7 @@
           type_casted_binds = type_casted_binds(binds)
           log(sql, name, binds, type_casted_binds) do
             ActiveSupport::Dependencies.interlock.permit_concurrent_loads do
-              @connection.async_exec(sql, type_casted_binds)
+              @connection.exec_params(sql, type_casted_binds)
             end
           end
         end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/lib/active_record/connection_adapters/sqlite3/quoting.rb 
new/lib/active_record/connection_adapters/sqlite3/quoting.rb
--- old/lib/active_record/connection_adapters/sqlite3/quoting.rb        
2019-03-13 17:45:27.000000000 +0100
+++ new/lib/active_record/connection_adapters/sqlite3/quoting.rb        
2019-03-28 03:46:04.000000000 +0100
@@ -15,6 +15,7 @@
         end
 
         def quoted_time(value)
+          value = value.change(year: 2000, month: 1, day: 1)
           quoted_date(value).sub(/\A\d\d\d\d-\d\d-\d\d /, "2000-01-01 ")
         end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/lib/active_record/connection_adapters/sqlite3_adapter.rb 
new/lib/active_record/connection_adapters/sqlite3_adapter.rb
--- old/lib/active_record/connection_adapters/sqlite3_adapter.rb        
2019-03-13 17:45:27.000000000 +0100
+++ new/lib/active_record/connection_adapters/sqlite3_adapter.rb        
2019-03-28 03:46:04.000000000 +0100
@@ -7,7 +7,7 @@
 require "active_record/connection_adapters/sqlite3/schema_dumper"
 require "active_record/connection_adapters/sqlite3/schema_statements"
 
-gem "sqlite3", "~> 1.3.6"
+gem "sqlite3", "~> 1.3", ">= 1.3.6"
 require "sqlite3"
 
 module ActiveRecord
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_record/counter_cache.rb 
new/lib/active_record/counter_cache.rb
--- old/lib/active_record/counter_cache.rb      2019-03-13 17:45:27.000000000 
+0100
+++ new/lib/active_record/counter_cache.rb      2019-03-28 03:46:04.000000000 
+0100
@@ -45,8 +45,12 @@
           reflection   = child_class._reflections.values.find { |e| 
e.belongs_to? && e.foreign_key.to_s == foreign_key && 
e.options[:counter_cache].present? }
           counter_name = reflection.counter_cache_column
 
-          updates = { counter_name.to_sym => 
object.send(counter_association).count(:all) }
-          updates.merge!(touch_updates(touch)) if touch
+          updates = { counter_name => 
object.send(counter_association).count(:all) }
+
+          if touch
+            names = touch if touch != true
+            updates.merge!(touch_attributes_with_time(*names))
+          end
 
           unscoped.where(primary_key => object.id).update_all(updates)
         end
@@ -66,8 +70,8 @@
       # * +counters+ - A Hash containing the names of the fields
       #   to update as keys and the amount to update the field by as values.
       # * <tt>:touch</tt> option - Touch timestamp columns when updating.
-      #   Pass +true+ to touch +updated_at+ and/or +updated_on+. Pass a symbol 
to
-      #   touch that column or an array of symbols to touch just those ones.
+      #   If attribute names are passed, they are updated along with 
updated_at/on
+      #   attributes.
       #
       # ==== Examples
       #
@@ -105,7 +109,8 @@
         end
 
         if touch
-          touch_updates = touch_updates(touch)
+          names = touch if touch != true
+          touch_updates = touch_attributes_with_time(*names)
           updates << sanitize_sql_for_assignment(touch_updates) unless 
touch_updates.empty?
         end
 
@@ -163,13 +168,6 @@
       def decrement_counter(counter_name, id, touch: nil)
         update_counters(id, counter_name => -1, touch: touch)
       end
-
-      private
-        def touch_updates(touch)
-          touch = timestamp_attributes_for_update_in_model if touch == true
-          touch_time = current_time_from_proper_timezone
-          Array(touch).map { |column| [ column, touch_time ] }.to_h
-        end
     end
 
     private
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_record/errors.rb 
new/lib/active_record/errors.rb
--- old/lib/active_record/errors.rb     2019-03-13 17:45:27.000000000 +0100
+++ new/lib/active_record/errors.rb     2019-03-28 03:46:04.000000000 +0100
@@ -115,16 +115,27 @@
 
   # Raised when a foreign key constraint cannot be added because the column 
type does not match the referenced column type.
   class MismatchedForeignKey < StatementInvalid
-    def initialize(adapter = nil, message: nil, table: nil, foreign_key: nil, 
target_table: nil, primary_key: nil)
-      @adapter = adapter
+    def initialize(
+      adapter = nil,
+      message: nil,
+      sql: nil,
+      binds: nil,
+      table: nil,
+      foreign_key: nil,
+      target_table: nil,
+      primary_key: nil,
+      primary_key_column: nil
+    )
       if table
-        msg = <<-EOM.strip_heredoc
-          Column `#{foreign_key}` on table `#{table}` has a type of 
`#{column_type(table, foreign_key)}`.
-          This does not match column `#{primary_key}` on `#{target_table}`, 
which has type `#{column_type(target_table, primary_key)}`.
-          To resolve this issue, change the type of the `#{foreign_key}` 
column on `#{table}` to be :integer. (For example `t.integer #{foreign_key}`).
+        type = primary_key_column.bigint? ? :bigint : primary_key_column.type
+        msg = <<-EOM.squish
+          Column `#{foreign_key}` on table `#{table}` does not match column 
`#{primary_key}` on `#{target_table}`,
+          which has type `#{primary_key_column.sql_type}`.
+          To resolve this issue, change the type of the `#{foreign_key}` 
column on `#{table}` to be :#{type}.
+          (For example `t.#{type} :#{foreign_key}`).
         EOM
       else
-        msg = <<-EOM
+        msg = <<-EOM.squish
           There is a mismatch between the foreign key and primary key column 
types.
           Verify that the foreign key column type and the primary key of the 
associated table match types.
         EOM
@@ -134,11 +145,6 @@
       end
       super(msg)
     end
-
-    private
-      def column_type(table, column)
-        @adapter.columns(table).detect { |c| c.name == column }.sql_type
-      end
   end
 
   # Raised when a record cannot be inserted or updated because it would 
violate a not null constraint.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_record/gem_version.rb 
new/lib/active_record/gem_version.rb
--- old/lib/active_record/gem_version.rb        2019-03-13 17:45:27.000000000 
+0100
+++ new/lib/active_record/gem_version.rb        2019-03-28 03:46:04.000000000 
+0100
@@ -7,8 +7,8 @@
   module VERSION
     MAJOR = 5
     MINOR = 1
-    TINY  = 6
-    PRE   = "2"
+    TINY  = 7
+    PRE   = nil
 
     STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
   end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_record/model_schema.rb 
new/lib/active_record/model_schema.rb
--- old/lib/active_record/model_schema.rb       2019-03-13 17:45:27.000000000 
+0100
+++ new/lib/active_record/model_schema.rb       2019-03-28 03:46:04.000000000 
+0100
@@ -381,7 +381,7 @@
       # default values when instantiating the Active Record object for this 
table.
       def column_defaults
         load_schema
-        _default_attributes.to_hash
+        _default_attributes.deep_dup.to_hash
       end
 
       def _default_attributes # :nodoc:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_record/persistence.rb 
new/lib/active_record/persistence.rb
--- old/lib/active_record/persistence.rb        2019-03-13 17:45:27.000000000 
+0100
+++ new/lib/active_record/persistence.rb        2019-03-28 03:46:04.000000000 
+0100
@@ -226,7 +226,8 @@
     def becomes(klass)
       became = klass.new
       became.instance_variable_set("@attributes", @attributes)
-      became.instance_variable_set("@mutation_tracker", @mutation_tracker) if 
defined?(@mutation_tracker)
+      became.instance_variable_set("@mutation_tracker", @mutation_tracker ||= 
nil)
+      became.instance_variable_set("@mutations_from_database", 
@mutations_from_database ||= nil)
       became.instance_variable_set("@changed_attributes", 
attributes_changed_by_setter)
       became.instance_variable_set("@new_record", new_record?)
       became.instance_variable_set("@destroyed", destroyed?)
@@ -506,7 +507,7 @@
       end
 
       attribute_names = timestamp_attributes_for_update_in_model
-      attribute_names.concat(names)
+      attribute_names |= names.map(&:to_s)
 
       unless attribute_names.empty?
         affected_rows = _touch_row(attribute_names, time)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_record/relation/finder_methods.rb 
new/lib/active_record/relation/finder_methods.rb
--- old/lib/active_record/relation/finder_methods.rb    2019-03-13 
17:45:27.000000000 +0100
+++ new/lib/active_record/relation/finder_methods.rb    2019-03-28 
03:46:04.000000000 +0100
@@ -379,7 +379,7 @@
 
         case conditions
         when Array, Hash
-          relation.where!(conditions)
+          relation.where!(conditions) unless conditions.empty?
         else
           relation.where!(primary_key => conditions) unless conditions == :none
         end
@@ -429,7 +429,7 @@
         raise UnknownPrimaryKey.new(@klass) if primary_key.nil?
 
         expects_array = ids.first.kind_of?(Array)
-        return ids.first if expects_array && ids.first.empty?
+        return [] if expects_array && ids.first.empty?
 
         ids = ids.flatten.compact.uniq
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_record/relation/predicate_builder.rb 
new/lib/active_record/relation/predicate_builder.rb
--- old/lib/active_record/relation/predicate_builder.rb 2019-03-13 
17:45:27.000000000 +0100
+++ new/lib/active_record/relation/predicate_builder.rb 2019-03-28 
03:46:04.000000000 +0100
@@ -95,7 +95,7 @@
             next
           when value.is_a?(Relation)
             binds += value.bound_attributes
-          when value.is_a?(Range) && 
!table.type(column_name).respond_to?(:subtype)
+          when value.is_a?(Range) && 
!table.type(column_name).force_equality?(value)
             first = value.begin
             last = value.end
             unless first.respond_to?(:infinite?) && first.infinite?
@@ -158,7 +158,7 @@
         return if table.associated_with?(column_name)
         case value
         when Array, Range
-          table.type(column_name).respond_to?(:subtype)
+          table.type(column_name).force_equality?(value)
         else
           !value.nil? && handler_for(value).is_a?(BasicObjectHandler)
         end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_record/relation/query_methods.rb 
new/lib/active_record/relation/query_methods.rb
--- old/lib/active_record/relation/query_methods.rb     2019-03-13 
17:45:27.000000000 +0100
+++ new/lib/active_record/relation/query_methods.rb     2019-03-28 
03:46:04.000000000 +0100
@@ -1079,7 +1079,7 @@
             end
             o.split(",").map! do |s|
               s.strip!
-              s.gsub!(/\sasc\Z/i, " DESC") || s.gsub!(/\sdesc\Z/i, " ASC") || 
s.concat(" DESC")
+              s.gsub!(/\sasc\Z/i, " DESC") || s.gsub!(/\sdesc\Z/i, " ASC") || 
(s << " DESC")
             end
           else
             o
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_record/tasks/database_tasks.rb 
new/lib/active_record/tasks/database_tasks.rb
--- old/lib/active_record/tasks/database_tasks.rb       2019-03-13 
17:45:27.000000000 +0100
+++ new/lib/active_record/tasks/database_tasks.rb       2019-03-28 
03:46:04.000000000 +0100
@@ -120,7 +120,7 @@
         $stderr.puts "Database '#{configuration['database']}' already exists"
       rescue Exception => error
         $stderr.puts error
-        $stderr.puts "Couldn't create database for #{configuration.inspect}"
+        $stderr.puts "Couldn't create '#{configuration['database']}' database. 
Please check your configuration."
         raise
       end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_record/timestamp.rb 
new/lib/active_record/timestamp.rb
--- old/lib/active_record/timestamp.rb  2019-03-13 17:45:27.000000000 +0100
+++ new/lib/active_record/timestamp.rb  2019-03-28 03:46:04.000000000 +0100
@@ -53,6 +53,13 @@
     end
 
     class_methods do
+      def touch_attributes_with_time(*names, time: nil)
+        attribute_names = timestamp_attributes_for_update_in_model
+        attribute_names |= names.map(&:to_s)
+        time ||= current_time_from_proper_timezone
+        attribute_names.each_with_object({}) { |attr_name, result| 
result[attr_name] = time }
+      end
+
       private
         def timestamp_attributes_for_create_in_model
           timestamp_attributes_for_create.select { |c| 
column_names.include?(c) }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_record/type/serialized.rb 
new/lib/active_record/type/serialized.rb
--- old/lib/active_record/type/serialized.rb    2019-03-13 17:45:27.000000000 
+0100
+++ new/lib/active_record/type/serialized.rb    2019-03-28 03:46:04.000000000 
+0100
@@ -49,6 +49,10 @@
         end
       end
 
+      def force_equality?(value)
+        coder.respond_to?(:object_class) && value.is_a?(coder.object_class)
+      end
+
       private
 
         def default_value?(value)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2019-03-13 17:45:26.000000000 +0100
+++ new/metadata        2019-03-28 03:46:04.000000000 +0100
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: activerecord
 version: !ruby/object:Gem::Version
-  version: 5.1.6.2
+  version: 5.1.7
 platform: ruby
 authors:
 - David Heinemeier Hansson
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2019-03-13 00:00:00.000000000 Z
+date: 2019-03-28 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: activesupport
@@ -16,28 +16,28 @@
     requirements:
     - - '='
       - !ruby/object:Gem::Version
-        version: 5.1.6.2
+        version: 5.1.7
   type: :runtime
   prerelease: false
   version_requirements: !ruby/object:Gem::Requirement
     requirements:
     - - '='
       - !ruby/object:Gem::Version
-        version: 5.1.6.2
+        version: 5.1.7
 - !ruby/object:Gem::Dependency
   name: activemodel
   requirement: !ruby/object:Gem::Requirement
     requirements:
     - - '='
       - !ruby/object:Gem::Version
-        version: 5.1.6.2
+        version: 5.1.7
   type: :runtime
   prerelease: false
   version_requirements: !ruby/object:Gem::Requirement
     requirements:
     - - '='
       - !ruby/object:Gem::Version
-        version: 5.1.6.2
+        version: 5.1.7
 - !ruby/object:Gem::Dependency
   name: arel
   requirement: !ruby/object:Gem::Requirement
@@ -320,8 +320,8 @@
 licenses:
 - MIT
 metadata:
-  source_code_uri: https://github.com/rails/rails/tree/v5.1.6.2/activerecord
-  changelog_uri: 
https://github.com/rails/rails/blob/v5.1.6.2/activerecord/CHANGELOG.md
+  source_code_uri: https://github.com/rails/rails/tree/v5.1.7/activerecord
+  changelog_uri: 
https://github.com/rails/rails/blob/v5.1.7/activerecord/CHANGELOG.md
 post_install_message: 
 rdoc_options:
 - "--main"


Reply via email to