Hello community,

here is the log from the commit of package rubygem-activerecord-5_0 for 
openSUSE:Factory checked in at 2017-07-10 11:06:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-activerecord-5_0 (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-activerecord-5_0.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-activerecord-5_0"

Mon Jul 10 11:06:44 2017 rev:6 rq:505375 version:5.0.4

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/rubygem-activerecord-5_0/rubygem-activerecord-5_0.changes
        2017-06-08 14:59:59.156572315 +0200
+++ 
/work/SRC/openSUSE:Factory/.rubygem-activerecord-5_0.new/rubygem-activerecord-5_0.changes
   2017-07-10 11:06:45.373617502 +0200
@@ -1,0 +2,23 @@
+Tue Jun 20 06:43:55 UTC 2017 - [email protected]
+
+- updated to version 5.0.4
+ see installed CHANGELOG.md
+
+  ## Rails 5.0.4 (June 19, 2017) ##
+  
+  *   Restore previous behavior of collection proxies: their values can have
+      methods stubbed, and they respect extension modules applied by a default
+      scope.
+  
+      *Ryuta Kamizono*
+  
+  *   Loading model schema from database is now thread-safe.
+  
+      Fixes #28589.
+  
+      *Vikrant Chaudhary*, *David Abdemoulaie*
+  
+  
+  ## Rails 5.0.3 (May 12, 2017) ##
+
+-------------------------------------------------------------------

Old:
----
  activerecord-5.0.3.gem

New:
----
  activerecord-5.0.4.gem

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

Other differences:
------------------
++++++ rubygem-activerecord-5_0.spec ++++++
--- /var/tmp/diff_new_pack.ihEOZh/_old  2017-07-10 11:06:45.909541818 +0200
+++ /var/tmp/diff_new_pack.ihEOZh/_new  2017-07-10 11:06:45.909541818 +0200
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-activerecord-5_0
-Version:        5.0.3
+Version:        5.0.4
 Release:        0
 %define mod_name activerecord
 %define mod_full_name %{mod_name}-%{version}

++++++ activerecord-5.0.3.gem -> activerecord-5.0.4.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md    2017-05-12 22:03:36.000000000 +0200
+++ new/CHANGELOG.md    2017-06-19 23:57:06.000000000 +0200
@@ -1,3 +1,20 @@
+## Rails 5.0.4 (June 19, 2017) ##
+
+*   Restore previous behavior of collection proxies: their values can have
+    methods stubbed, and they respect extension modules applied by a default
+    scope.
+
+    *Ryuta Kamizono*
+
+*   Loading model schema from database is now thread-safe.
+
+    Fixes #28589.
+
+    *Vikrant Chaudhary*, *David Abdemoulaie*
+
+
+## Rails 5.0.3 (May 12, 2017) ##
+
 *   Check whether `Rails.application` defined before calling it
 
     In #27674 we changed the migration generator to generate migrations at the
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/association.rb 
new/lib/active_record/associations/association.rb
--- old/lib/active_record/associations/association.rb   2017-05-12 
22:03:36.000000000 +0200
+++ new/lib/active_record/associations/association.rb   2017-06-19 
23:57:06.000000000 +0200
@@ -124,6 +124,16 @@
         AssociationRelation.create(klass, klass.arel_table, 
klass.predicate_builder, self).merge!(klass.all)
       end
 
+      def extensions
+        extensions = klass.default_extensions | reflection.extensions
+
+        if scope = reflection.scope
+          extensions |= klass.unscoped.instance_exec(owner, &scope).extensions
+        end
+
+        extensions
+      end
+
       # Loads the \target if needed and returns it.
       #
       # This method is abstract in the sense that it relies on +find_target+,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_record/associations/association_scope.rb 
new/lib/active_record/associations/association_scope.rb
--- old/lib/active_record/associations/association_scope.rb     2017-05-12 
22:03:36.000000000 +0200
+++ new/lib/active_record/associations/association_scope.rb     2017-06-19 
23:57:06.000000000 +0200
@@ -24,7 +24,7 @@
         alias_tracker = AliasTracker.create connection, 
association.klass.table_name, klass.type_caster
         chain_head, chain_tail = get_chain(reflection, association, 
alias_tracker)
 
-        scope.extending! Array(reflection.options[:extend])
+        scope.extending! reflection.extensions
         add_constraints(scope, owner, klass, reflection, chain_head, 
chain_tail)
       end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/lib/active_record/associations/collection_association.rb 
new/lib/active_record/associations/collection_association.rb
--- old/lib/active_record/associations/collection_association.rb        
2017-05-12 22:03:36.000000000 +0200
+++ new/lib/active_record/associations/collection_association.rb        
2017-06-19 23:57:06.000000000 +0200
@@ -39,7 +39,8 @@
           reload
         end
 
-        CollectionProxy.create(klass, self)
+        @proxy ||= CollectionProxy.create(klass, self)
+        @proxy.reset_scope
       end
 
       # Implements the writer method, e.g. foo.items= for Foo.has_many :items
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_record/associations/collection_proxy.rb 
new/lib/active_record/associations/collection_proxy.rb
--- old/lib/active_record/associations/collection_proxy.rb      2017-05-12 
22:03:36.000000000 +0200
+++ new/lib/active_record/associations/collection_proxy.rb      2017-06-19 
23:57:06.000000000 +0200
@@ -31,6 +31,9 @@
       def initialize(klass, association) #:nodoc:
         @association = association
         super klass, klass.arel_table, klass.predicate_builder
+
+        extensions = association.extensions
+        extend(*extensions) if extensions.any?
       end
 
       def target
@@ -1034,9 +1037,8 @@
       #   person.pets(true)  # fetches pets from the database
       #   # => [#<Pet id: 1, name: "Snoop", group: "dogs", person_id: 1>]
       def reload
-        @scope = nil
         proxy_association.reload
-        self
+        reset_scope
       end
 
       # Unloads the association. Returns +self+.
@@ -1056,9 +1058,13 @@
       #   person.pets  # fetches pets from the database
       #   # => [#<Pet id: 1, name: "Snoop", group: "dogs", person_id: 1>]
       def reset
-        @scope = nil
         proxy_association.reset
         proxy_association.reset_scope
+        reset_scope
+      end
+
+      def reset_scope # :nodoc:
+        @scope = nil
         self
       end
 
@@ -1071,36 +1077,15 @@
 
       delegate(*delegate_methods, to: :scope)
 
-      module DelegateExtending # :nodoc:
-        private
-          def method_missing(method, *args, &block)
-            extending_values = association_scope.extending_values
-            if extending_values.any? && (extending_values - 
self.class.included_modules).any?
-              self.class.include(*extending_values)
-              public_send(method, *args, &block)
-            else
-              super
-            end
-          end
-      end
-
       private
 
         def null_scope?
           @association.null_scope?
         end
 
-        def association_scope
-          @association.association_scope
-        end
-
         def exec_queries
           load_target
         end
-
-        def respond_to_missing?(method, _)
-          association_scope.respond_to?(method) || super
-        end
     end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/lib/active_record/connection_adapters/abstract/schema_definitions.rb 
new/lib/active_record/connection_adapters/abstract/schema_definitions.rb
--- old/lib/active_record/connection_adapters/abstract/schema_definitions.rb    
2017-05-12 22:03:36.000000000 +0200
+++ new/lib/active_record/connection_adapters/abstract/schema_definitions.rb    
2017-06-19 23:57:06.000000000 +0200
@@ -112,7 +112,7 @@
       end
 
       def polymorphic_options
-        as_options(polymorphic)
+        as_options(polymorphic).merge(null: options[:null])
       end
 
       def index_options
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/lib/active_record/connection_adapters/postgresql/schema_statements.rb 
new/lib/active_record/connection_adapters/postgresql/schema_statements.rb
--- old/lib/active_record/connection_adapters/postgresql/schema_statements.rb   
2017-05-12 22:03:36.000000000 +0200
+++ new/lib/active_record/connection_adapters/postgresql/schema_statements.rb   
2017-06-19 23:57:07.000000000 +0200
@@ -375,9 +375,17 @@
 
           if pk && sequence
             quoted_sequence = quote_table_name(sequence)
+            max_pk = select_value("select MAX(#{quote_column_name pk}) from 
#{quote_table_name(table)}")
+            if max_pk.nil?
+              if postgresql_version >= 100000
+                minvalue = select_value("SELECT seqmin from pg_sequence where 
seqrelid = '#{quoted_sequence}'::regclass")
+              else
+                minvalue = select_value("SELECT min_value FROM 
#{quoted_sequence}")
+              end
+            end
 
-            select_value(<<-end_sql, 'SCHEMA')
-              SELECT setval('#{quoted_sequence}', (SELECT 
COALESCE(MAX(#{quote_column_name pk})+(SELECT increment_by FROM 
#{quoted_sequence}), (SELECT min_value FROM #{quoted_sequence})) FROM 
#{quote_table_name(table)}), false)
+            select_value(<<-end_sql, "SCHEMA")
+              SELECT setval('#{quoted_sequence}', #{max_pk ? max_pk : 
minvalue}, #{max_pk ? true : false})
             end_sql
           end
         end
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        2017-05-12 22:03:36.000000000 
+0200
+++ new/lib/active_record/gem_version.rb        2017-06-19 23:57:07.000000000 
+0200
@@ -7,7 +7,7 @@
   module VERSION
     MAJOR = 5
     MINOR = 0
-    TINY  = 3
+    TINY  = 4
     PRE   = nil
 
     STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
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       2017-05-12 22:03:36.000000000 
+0200
+++ new/lib/active_record/model_schema.rb       2017-06-19 23:57:07.000000000 
+0200
@@ -1,3 +1,5 @@
+require "monitor"
+
 module ActiveRecord
   module ModelSchema
     extend ActiveSupport::Concern
@@ -152,6 +154,8 @@
       self.inheritance_column = 'type'
 
       delegate :type_for_attribute, to: :class
+
+      initialize_load_schema_monitor
     end
 
     # Derives the join table name for +first_table+ and +second_table+. The
@@ -426,15 +430,31 @@
         initialize_find_by_cache
       end
 
+      protected
+
+      def initialize_load_schema_monitor
+        @load_schema_monitor = Monitor.new
+      end
+
       private
 
+      def inherited(child_class)
+        super
+        child_class.initialize_load_schema_monitor
+      end
+
       def schema_loaded?
-        defined?(@columns_hash) && @columns_hash
+        defined?(@schema_loaded) && @schema_loaded
       end
 
       def load_schema
-        unless schema_loaded?
+        return if schema_loaded?
+        @load_schema_monitor.synchronize do
+          return if defined?(@columns_hash) && @columns_hash
+
           load_schema!
+
+          @schema_loaded = true
         end
       end
 
@@ -462,6 +482,7 @@
         @attributes_builder = nil
         @columns = nil
         @columns_hash = nil
+        @schema_loaded = false
         @attribute_names = nil
         direct_descendants.each do |descendant|
           descendant.send(:reload_schema_from_cache)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_record/reflection.rb 
new/lib/active_record/reflection.rb
--- old/lib/active_record/reflection.rb 2017-05-12 22:03:36.000000000 +0200
+++ new/lib/active_record/reflection.rb 2017-06-19 23:57:07.000000000 +0200
@@ -527,6 +527,10 @@
         seed + [self]
       end
 
+      def extensions
+        Array(options[:extend])
+      end
+
       protected
 
         def actual_source_reflection # FIXME: this is a horrible name
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_record/relation/batches.rb 
new/lib/active_record/relation/batches.rb
--- old/lib/active_record/relation/batches.rb   2017-05-12 22:03:36.000000000 
+0200
+++ new/lib/active_record/relation/batches.rb   2017-06-19 23:57:07.000000000 
+0200
@@ -30,11 +30,11 @@
     #   end
     #
     # ==== Options
-    # * <tt>:batch_size</tt> - Specifies the size of the batch. Default to 
1000.
+    # * <tt>:batch_size</tt> - Specifies the size of the batch. Defaults to 
1000.
     # * <tt>:start</tt> - Specifies the primary key value to start from, 
inclusive of the value.
     # * <tt>:finish</tt> - Specifies the primary key value to end at, 
inclusive of the value.
     # * <tt>:error_on_ignore</tt> - Overrides the application config to 
specify if an error should be raised when
-    #                               the order and limit have to be ignored due 
to batching.
+    #   the order and limit have to be ignored due to batching.
     #
     # This is especially useful if you want multiple workers dealing with
     # the same processing queue. You can make worker 1 handle all the records
@@ -85,11 +85,11 @@
     # To be yielded each record one by one, use #find_each instead.
     #
     # ==== Options
-    # * <tt>:batch_size</tt> - Specifies the size of the batch. Default to 
1000.
+    # * <tt>:batch_size</tt> - Specifies the size of the batch. Defaults to 
1000.
     # * <tt>:start</tt> - Specifies the primary key value to start from, 
inclusive of the value.
     # * <tt>:finish</tt> - Specifies the primary key value to end at, 
inclusive of the value.
     # * <tt>:error_on_ignore</tt> - Overrides the application config to 
specify if an error should be raised when
-    #                               the order and limit have to be ignored due 
to batching.
+    #   the order and limit have to be ignored due to batching.
     #
     # This is especially useful if you want multiple workers dealing with
     # the same processing queue. You can make worker 1 handle all the records
@@ -132,9 +132,9 @@
     # If you do not provide a block to #in_batches, it will return a
     # BatchEnumerator which is enumerable.
     #
-    #   Person.in_batches.with_index do |relation, batch_index|
+    #   Person.in_batches.each_with_index do |relation, batch_index|
     #     puts "Processing relation ##{batch_index}"
-    #     relation.each { |relation| relation.delete_all }
+    #     relation.delete_all
     #   end
     #
     # Examples of calling methods on the returned BatchEnumerator object:
@@ -144,12 +144,12 @@
     #   Person.in_batches.each_record(&:party_all_night!)
     #
     # ==== Options
-    # * <tt>:of</tt> - Specifies the size of the batch. Default to 1000.
-    # * <tt>:load</tt> - Specifies if the relation should be loaded. Default 
to false.
+    # * <tt>:of</tt> - Specifies the size of the batch. Defaults to 1000.
+    # * <tt>:load</tt> - Specifies if the relation should be loaded. Defaults 
to false.
     # * <tt>:start</tt> - Specifies the primary key value to start from, 
inclusive of the value.
     # * <tt>:finish</tt> - Specifies the primary key value to end at, 
inclusive of the value.
     # * <tt>:error_on_ignore</tt> - Overrides the application config to 
specify if an error should be raised when
-    #                               the order and limit have to be ignored due 
to batching.
+    #   the order and limit have to be ignored due to batching.
     #
     # This is especially useful if you want to work with the
     # ActiveRecord::Relation object instead of the array of records, or if
@@ -176,7 +176,7 @@
     #
     # NOTE: It's not possible to set the order. That is automatically set to
     # ascending on the primary key ("id ASC") to make the batch ordering
-    # consistent. Therefore the primary key must be orderable, e.g an integer
+    # consistent. Therefore the primary key must be orderable, e.g. an integer
     # or a string.
     #
     # NOTE: You can't set the limit either, that's used to control the batch
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_record/relation/delegation.rb 
new/lib/active_record/relation/delegation.rb
--- old/lib/active_record/relation/delegation.rb        2017-05-12 
22:03:36.000000000 +0200
+++ new/lib/active_record/relation/delegation.rb        2017-06-19 
23:57:07.000000000 +0200
@@ -24,8 +24,6 @@
 
       def inherited(child_class)
         child_class.initialize_relation_delegate_cache
-        delegate = 
child_class.relation_delegate_class(ActiveRecord::Associations::CollectionProxy)
-        delegate.include 
ActiveRecord::Associations::CollectionProxy::DelegateExtending
         super
       end
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_record/scoping/default.rb 
new/lib/active_record/scoping/default.rb
--- old/lib/active_record/scoping/default.rb    2017-05-12 22:03:36.000000000 
+0200
+++ new/lib/active_record/scoping/default.rb    2017-06-19 23:57:07.000000000 
+0200
@@ -110,7 +110,11 @@
 
           if self.default_scope_override
             # The user has defined their own default scope method, so call that
-            evaluate_default_scope { default_scope }
+            evaluate_default_scope do
+              if scope = default_scope
+                (base_rel ||= relation).merge(scope)
+              end
+            end
           elsif default_scopes.any?
             base_rel ||= relation
             evaluate_default_scope do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_record/scoping/named.rb 
new/lib/active_record/scoping/named.rb
--- old/lib/active_record/scoping/named.rb      2017-05-12 22:03:36.000000000 
+0200
+++ new/lib/active_record/scoping/named.rb      2017-06-19 23:57:07.000000000 
+0200
@@ -30,12 +30,15 @@
         end
 
         def default_scoped # :nodoc:
-          scope = build_default_scope
+          scope = relation
+          build_default_scope(scope) || scope
+        end
 
-          if scope
-            relation.spawn.merge!(scope)
+        def default_extensions # :nodoc:
+          if scope = current_scope || build_default_scope
+            scope.extensions
           else
-            relation
+            []
           end
         end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2017-05-12 22:03:36.000000000 +0200
+++ new/metadata        2017-06-19 23:57:06.000000000 +0200
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: activerecord
 version: !ruby/object:Gem::Version
-  version: 5.0.3
+  version: 5.0.4
 platform: ruby
 authors:
 - David Heinemeier Hansson
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2017-05-12 00:00:00.000000000 Z
+date: 2017-06-19 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: activesupport
@@ -16,28 +16,28 @@
     requirements:
     - - '='
       - !ruby/object:Gem::Version
-        version: 5.0.3
+        version: 5.0.4
   type: :runtime
   prerelease: false
   version_requirements: !ruby/object:Gem::Requirement
     requirements:
     - - '='
       - !ruby/object:Gem::Version
-        version: 5.0.3
+        version: 5.0.4
 - !ruby/object:Gem::Dependency
   name: activemodel
   requirement: !ruby/object:Gem::Requirement
     requirements:
     - - '='
       - !ruby/object:Gem::Version
-        version: 5.0.3
+        version: 5.0.4
   type: :runtime
   prerelease: false
   version_requirements: !ruby/object:Gem::Requirement
     requirements:
     - - '='
       - !ruby/object:Gem::Version
-        version: 5.0.3
+        version: 5.0.4
 - !ruby/object:Gem::Dependency
   name: arel
   requirement: !ruby/object:Gem::Requirement
@@ -328,9 +328,8 @@
       version: '0'
 requirements: []
 rubyforge_project: 
-rubygems_version: 2.6.10
+rubygems_version: 2.6.12
 signing_key: 
 specification_version: 4
 summary: Object-relational mapper framework (part of Rails).
 test_files: []
-has_rdoc: 


Reply via email to