activemodel 7.2.0.beta3 → 7.2.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/active_model/gem_version.rb +1 -1
- data/lib/active_model/type/helpers/time_value.rb +26 -11
- data/lib/active_model/type/helpers/timezone.rb +5 -1
- metadata +7 -7
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 4e4af947ba350cc2f26dbd4e5b56ddecb3b9d93dd54a99834713be23726c83d1
         | 
| 4 | 
            +
              data.tar.gz: 6929a8bb5679a900bc99a032e35b39689783ebcdd761e40373217ab7b94ad54c
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: d213f2746a84034813f0f0b7d8d0fb6e234d4675114a2111ed94681c40efc3ef32a53a5eb7a9bd6cfbf7d11887bf6c048404ee3e5fc7f746c51fe48ebb084923
         | 
| 7 | 
            +
              data.tar.gz: 4f871ca04625b04cb48b30c48c683069f90ce31ef96cb554f6c2000785325105cc2241a8ae67ad0e24181a0feebcffb8188da7c85a58e68183dc949a3ea2f137
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    
| @@ -70,18 +70,33 @@ module ActiveModel | |
| 70 70 | 
             
                      /x
         | 
| 71 71 |  | 
| 72 72 | 
             
                      if RUBY_VERSION >= "3.2"
         | 
| 73 | 
            -
                         | 
| 74 | 
            -
                           | 
| 75 | 
            -
             | 
| 76 | 
            -
                           | 
| 77 | 
            -
             | 
| 78 | 
            -
                             | 
| 79 | 
            -
             | 
| 80 | 
            -
             | 
| 81 | 
            -
             | 
| 73 | 
            +
                        if Time.new(2000, 1, 1, 0, 0, 0, "-00:00").yday != 1 # Early 3.2.x had a bug
         | 
| 74 | 
            +
                          # BUG: Wrapping the Time object with Time.at because Time.new with `in:` in Ruby 3.2.0
         | 
| 75 | 
            +
                          # used to return an invalid Time object
         | 
| 76 | 
            +
                          # see: https://bugs.ruby-lang.org/issues/19292
         | 
| 77 | 
            +
                          def fast_string_to_time(string)
         | 
| 78 | 
            +
                            return unless string.include?("-") #  Time.new("1234") # => 1234-01-01 00:00:00
         | 
| 79 | 
            +
             | 
| 80 | 
            +
                            if is_utc?
         | 
| 81 | 
            +
                              ::Time.at(::Time.new(string, in: "UTC"))
         | 
| 82 | 
            +
                            else
         | 
| 83 | 
            +
                              ::Time.new(string)
         | 
| 84 | 
            +
                            end
         | 
| 85 | 
            +
                          rescue ArgumentError
         | 
| 86 | 
            +
                            nil
         | 
| 87 | 
            +
                          end
         | 
| 88 | 
            +
                        else
         | 
| 89 | 
            +
                          def fast_string_to_time(string)
         | 
| 90 | 
            +
                            return unless string.include?("-") #  Time.new("1234") # => 1234-01-01 00:00:00
         | 
| 91 | 
            +
             | 
| 92 | 
            +
                            if is_utc?
         | 
| 93 | 
            +
                              ::Time.new(string, in: "UTC")
         | 
| 94 | 
            +
                            else
         | 
| 95 | 
            +
                              ::Time.new(string)
         | 
| 96 | 
            +
                            end
         | 
| 97 | 
            +
                          rescue ArgumentError
         | 
| 98 | 
            +
                            nil
         | 
| 82 99 | 
             
                          end
         | 
| 83 | 
            -
                        rescue ArgumentError
         | 
| 84 | 
            -
                          nil
         | 
| 85 100 | 
             
                        end
         | 
| 86 101 | 
             
                      else
         | 
| 87 102 | 
             
                        def fast_string_to_time(string)
         | 
| @@ -7,7 +7,11 @@ module ActiveModel | |
| 7 7 | 
             
                module Helpers # :nodoc: all
         | 
| 8 8 | 
             
                  module Timezone
         | 
| 9 9 | 
             
                    def is_utc?
         | 
| 10 | 
            -
                       | 
| 10 | 
            +
                      if default = ::Time.zone_default
         | 
| 11 | 
            +
                        default.name == "UTC"
         | 
| 12 | 
            +
                      else
         | 
| 13 | 
            +
                        true
         | 
| 14 | 
            +
                      end
         | 
| 11 15 | 
             
                    end
         | 
| 12 16 |  | 
| 13 17 | 
             
                    def default_timezone
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: activemodel
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 7.2.0. | 
| 4 | 
            +
              version: 7.2.0.rc1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - David Heinemeier Hansson
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2024- | 
| 11 | 
            +
            date: 2024-08-06 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: activesupport
         | 
| @@ -16,14 +16,14 @@ dependencies: | |
| 16 16 | 
             
                requirements:
         | 
| 17 17 | 
             
                - - '='
         | 
| 18 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            -
                    version: 7.2.0. | 
| 19 | 
            +
                    version: 7.2.0.rc1
         | 
| 20 20 | 
             
              type: :runtime
         | 
| 21 21 | 
             
              prerelease: false
         | 
| 22 22 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 23 | 
             
                requirements:
         | 
| 24 24 | 
             
                - - '='
         | 
| 25 25 | 
             
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            -
                    version: 7.2.0. | 
| 26 | 
            +
                    version: 7.2.0.rc1
         | 
| 27 27 | 
             
            description: A toolkit for building modeling frameworks like Active Record. Rich support
         | 
| 28 28 | 
             
              for attributes, callbacks, validations, serialization, internationalization, and
         | 
| 29 29 | 
             
              testing.
         | 
| @@ -112,10 +112,10 @@ licenses: | |
| 112 112 | 
             
            - MIT
         | 
| 113 113 | 
             
            metadata:
         | 
| 114 114 | 
             
              bug_tracker_uri: https://github.com/rails/rails/issues
         | 
| 115 | 
            -
              changelog_uri: https://github.com/rails/rails/blob/v7.2.0. | 
| 116 | 
            -
              documentation_uri: https://api.rubyonrails.org/v7.2.0. | 
| 115 | 
            +
              changelog_uri: https://github.com/rails/rails/blob/v7.2.0.rc1/activemodel/CHANGELOG.md
         | 
| 116 | 
            +
              documentation_uri: https://api.rubyonrails.org/v7.2.0.rc1/
         | 
| 117 117 | 
             
              mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
         | 
| 118 | 
            -
              source_code_uri: https://github.com/rails/rails/tree/v7.2.0. | 
| 118 | 
            +
              source_code_uri: https://github.com/rails/rails/tree/v7.2.0.rc1/activemodel
         | 
| 119 119 | 
             
              rubygems_mfa_required: 'true'
         | 
| 120 120 | 
             
            post_install_message:
         | 
| 121 121 | 
             
            rdoc_options: []
         |