Hello community,

here is the log from the commit of package rubygem-activemodel-5.2 for 
openSUSE:Factory checked in at 2019-01-21 10:26:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-activemodel-5.2 (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-activemodel-5.2.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-activemodel-5.2"

Mon Jan 21 10:26:42 2019 rev:4 rq:656395 version:5.2.2

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/rubygem-activemodel-5.2/rubygem-activemodel-5.2.changes
  2018-12-06 12:17:55.161480995 +0100
+++ 
/work/SRC/openSUSE:Factory/.rubygem-activemodel-5.2.new.28833/rubygem-activemodel-5.2.changes
       2019-01-21 10:26:46.881656532 +0100
@@ -1,0 +2,14 @@
+Sat Dec  8 16:15:31 UTC 2018 - Stephan Kulow <[email protected]>
+
+- updated to version 5.2.2
+ see installed CHANGELOG.md
+
+  ## Rails 5.2.2 (December 04, 2018) ##
+  
+  *   Fix numericality validator to still use value before type cast except 
Active Record.
+  
+      Fixes #33651, #33686.
+  
+      *Ryuta Kamizono*
+
+-------------------------------------------------------------------

Old:
----
  activemodel-5.2.1.1.gem

New:
----
  activemodel-5.2.2.gem

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

Other differences:
------------------
++++++ rubygem-activemodel-5.2.spec ++++++
--- /var/tmp/diff_new_pack.eekWNd/_old  2019-01-21 10:26:47.445655913 +0100
+++ /var/tmp/diff_new_pack.eekWNd/_new  2019-01-21 10:26:47.445655913 +0100
@@ -12,7 +12,7 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-activemodel-5.2
-Version:        5.2.1.1
+Version:        5.2.2
 Release:        0
 %define mod_name activemodel
 %define mod_full_name %{mod_name}-%{version}
@@ -36,9 +36,9 @@
 %endif
 # /MANUAL
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-BuildRequires:  ruby-macros >= 5
 BuildRequires:  %{ruby >= 2.2.2}
 BuildRequires:  %{rubygem gem2rpm}
+BuildRequires:  ruby-macros >= 5
 Url:            http://rubyonrails.org
 Source:         https://rubygems.org/gems/%{mod_full_name}.gem
 Source1:        gem2rpm.yml

++++++ activemodel-5.2.1.1.gem -> activemodel-5.2.2.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md    2018-11-27 21:12:12.000000000 +0100
+++ new/CHANGELOG.md    2018-12-04 19:11:59.000000000 +0100
@@ -1,3 +1,12 @@
+## Rails 5.2.2 (December 04, 2018) ##
+
+*   Fix numericality validator to still use value before type cast except 
Active Record.
+
+    Fixes #33651, #33686.
+
+    *Ryuta Kamizono*
+
+
 ## Rails 5.2.1.1 (November 27, 2018) ##
 
 *   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_model/attribute.rb 
new/lib/active_model/attribute.rb
--- old/lib/active_model/attribute.rb   2018-11-27 21:12:12.000000000 +0100
+++ new/lib/active_model/attribute.rb   2018-12-04 19:11:59.000000000 +0100
@@ -207,6 +207,7 @@
           raise ActiveModel::MissingAttributeError, "can't write unknown 
attribute `#{name}`"
         end
         alias_method :with_value_from_user, :with_value_from_database
+        alias_method :with_cast_value, :with_value_from_database
       end
 
       class Uninitialized < Attribute # :nodoc:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_model/dirty.rb 
new/lib/active_model/dirty.rb
--- old/lib/active_model/dirty.rb       2018-11-27 21:12:12.000000000 +0100
+++ new/lib/active_model/dirty.rb       2018-12-04 19:11:59.000000000 +0100
@@ -141,7 +141,9 @@
       @mutations_from_database = nil
     end
 
-    def changes_applied # :nodoc:
+    # Clears dirty data and moves +changes+ to +previously_changed+ and
+    # +mutations_from_database+ to +mutations_before_last_save+ respectively.
+    def changes_applied
       unless defined?(@attributes)
         @previously_changed = changes
       end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_model/errors.rb 
new/lib/active_model/errors.rb
--- old/lib/active_model/errors.rb      2018-11-27 21:12:12.000000000 +0100
+++ new/lib/active_model/errors.rb      2018-12-04 19:11:59.000000000 +0100
@@ -322,11 +322,11 @@
     #  person.errors.added? :name, :too_long                                # 
=> false
     #  person.errors.added? :name, "is too long"                            # 
=> false
     def added?(attribute, message = :invalid, options = {})
+      message = message.call if message.respond_to?(:call)
+
       if message.is_a? Symbol
-        self.details[attribute.to_sym].map { |e| e[:error] }.include? message
+        details[attribute.to_sym].include? normalize_detail(message, options)
       else
-        message = message.call if message.respond_to?(:call)
-        message = normalize_message(attribute, message, options)
         self[attribute].include? message
       end
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_model/gem_version.rb 
new/lib/active_model/gem_version.rb
--- old/lib/active_model/gem_version.rb 2018-11-27 21:12:12.000000000 +0100
+++ new/lib/active_model/gem_version.rb 2018-12-04 19:11:59.000000000 +0100
@@ -9,8 +9,8 @@
   module VERSION
     MAJOR = 5
     MINOR = 2
-    TINY  = 1
-    PRE   = "1"
+    TINY  = 2
+    PRE   = nil
 
     STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
   end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_model/type/helpers/numeric.rb 
new/lib/active_model/type/helpers/numeric.rb
--- old/lib/active_model/type/helpers/numeric.rb        2018-11-27 
21:12:12.000000000 +0100
+++ new/lib/active_model/type/helpers/numeric.rb        2018-12-04 
19:11:59.000000000 +0100
@@ -29,7 +29,7 @@
             # 'wibble'.to_i will give zero, we want to make sure
             # that we aren't marking int zero to string zero as
             # changed.
-            value.to_s !~ /\A-?\d+\.?\d*\z/
+            !/\A[-+]?\d+/.match?(value.to_s)
           end
       end
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/active_model/validations/numericality.rb 
new/lib/active_model/validations/numericality.rb
--- old/lib/active_model/validations/numericality.rb    2018-11-27 
21:12:12.000000000 +0100
+++ new/lib/active_model/validations/numericality.rb    2018-12-04 
19:12:00.000000000 +0100
@@ -21,8 +21,17 @@
       def validate_each(record, attr_name, value)
         came_from_user = :"#{attr_name}_came_from_user?"
 
-        if record.respond_to?(came_from_user) && 
record.public_send(came_from_user)
-          raw_value = record.read_attribute_before_type_cast(attr_name)
+        if record.respond_to?(came_from_user)
+          if record.public_send(came_from_user)
+            raw_value = record.read_attribute_before_type_cast(attr_name)
+          elsif record.respond_to?(:read_attribute)
+            raw_value = record.read_attribute(attr_name)
+          end
+        else
+          before_type_cast = :"#{attr_name}_before_type_cast"
+          if record.respond_to?(before_type_cast)
+            raw_value = record.public_send(before_type_cast)
+          end
         end
         raw_value ||= value
 
@@ -77,13 +86,17 @@
 
       def parse_raw_value_as_a_number(raw_value)
         return raw_value.to_i if is_integer?(raw_value)
-        Kernel.Float(raw_value) if raw_value !~ /\A0[xX]/
+        Kernel.Float(raw_value) unless is_hexadecimal_literal?(raw_value)
       end
 
       def is_integer?(raw_value)
         /\A[+-]?\d+\z/ === raw_value.to_s
       end
 
+      def is_hexadecimal_literal?(raw_value)
+        /\A0[xX]/ === raw_value
+      end
+
       def filtered_options(value)
         filtered = options.except(*RESERVED_OPTIONS)
         filtered[:value] = value
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2018-11-27 21:12:12.000000000 +0100
+++ new/metadata        2018-12-04 19:11:59.000000000 +0100
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: activemodel
 version: !ruby/object:Gem::Version
-  version: 5.2.1.1
+  version: 5.2.2
 platform: ruby
 authors:
 - David Heinemeier Hansson
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2018-11-27 00:00:00.000000000 Z
+date: 2018-12-04 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: activesupport
@@ -16,14 +16,14 @@
     requirements:
     - - '='
       - !ruby/object:Gem::Version
-        version: 5.2.1.1
+        version: 5.2.2
   type: :runtime
   prerelease: false
   version_requirements: !ruby/object:Gem::Requirement
     requirements:
     - - '='
       - !ruby/object:Gem::Version
-        version: 5.2.1.1
+        version: 5.2.2
 description: A toolkit for building modeling frameworks like Active Record. 
Rich support
   for attributes, callbacks, validations, serialization, internationalization, 
and
   testing.
@@ -100,8 +100,8 @@
 licenses:
 - MIT
 metadata:
-  source_code_uri: https://github.com/rails/rails/tree/v5.2.1.1/activemodel
-  changelog_uri: 
https://github.com/rails/rails/blob/v5.2.1.1/activemodel/CHANGELOG.md
+  source_code_uri: https://github.com/rails/rails/tree/v5.2.2/activemodel
+  changelog_uri: 
https://github.com/rails/rails/blob/v5.2.2/activemodel/CHANGELOG.md
 post_install_message: 
 rdoc_options: []
 require_paths:


Reply via email to