activemodel 5.1.4 → 5.1.5.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 +5 -5
- data/CHANGELOG.md +6 -0
- data/lib/active_model/gem_version.rb +2 -2
- data/lib/active_model/validations/callbacks.rb +13 -9
- metadata +10 -8
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 | 
            -
             | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 2 | 
            +
            SHA256:
         | 
| 3 | 
            +
              metadata.gz: ee08b52469bd21af38d855b94e1c64ad758bdf478bead7d15105261be33a0791
         | 
| 4 | 
            +
              data.tar.gz: a89bd9a6f70e49a110809fb6825cfe4d93faea56d2aa6d6dadfa918d7780e672
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 182830a35abde2b82043f381f439296597f73f5401d231593f641b419474c3ce44ae21ae73ff3b77d724494be5ed19ed3d275d7daed4d8d9475ee58653ddd2e5
         | 
| 7 | 
            +
              data.tar.gz: c23097e6c0b07b959b00f9fa2530d556727607ab22107c155202fab34ba368eb2b70677cd548e0cc00ed2088f2d02bb5114b4c0452345694db302edae92b7100
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    
| @@ -52,14 +52,16 @@ module ActiveModel | |
| 52 52 | 
             
                    #   person.valid? # => true
         | 
| 53 53 | 
             
                    #   person.name   # => "bob"
         | 
| 54 54 | 
             
                    def before_validation(*args, &block)
         | 
| 55 | 
            -
                      options = args. | 
| 56 | 
            -
                      if  | 
| 57 | 
            -
             | 
| 58 | 
            -
             | 
| 55 | 
            +
                      options = args.extract_options!
         | 
| 56 | 
            +
                      options[:if] = Array(options[:if])
         | 
| 57 | 
            +
             | 
| 58 | 
            +
                      if options.key?(:on)
         | 
| 59 59 | 
             
                        options[:if].unshift ->(o) {
         | 
| 60 | 
            -
                          options[:on] | 
| 60 | 
            +
                          !(Array(options[:on]) & Array(o.validation_context)).empty?
         | 
| 61 61 | 
             
                        }
         | 
| 62 62 | 
             
                      end
         | 
| 63 | 
            +
             | 
| 64 | 
            +
                      args << options
         | 
| 63 65 | 
             
                      set_callback(:validation, :before, *args, &block)
         | 
| 64 66 | 
             
                    end
         | 
| 65 67 |  | 
| @@ -93,13 +95,15 @@ module ActiveModel | |
| 93 95 | 
             
                      options = args.extract_options!
         | 
| 94 96 | 
             
                      options[:prepend] = true
         | 
| 95 97 | 
             
                      options[:if] = Array(options[:if])
         | 
| 96 | 
            -
             | 
| 97 | 
            -
             | 
| 98 | 
            +
             | 
| 99 | 
            +
                      if options.key?(:on)
         | 
| 98 100 | 
             
                        options[:if].unshift ->(o) {
         | 
| 99 | 
            -
                          options[:on] | 
| 101 | 
            +
                          !(Array(options[:on]) & Array(o.validation_context)).empty?
         | 
| 100 102 | 
             
                        }
         | 
| 101 103 | 
             
                      end
         | 
| 102 | 
            -
             | 
| 104 | 
            +
             | 
| 105 | 
            +
                      args << options
         | 
| 106 | 
            +
                      set_callback(:validation, :after, *args, &block)
         | 
| 103 107 | 
             
                    end
         | 
| 104 108 | 
             
                  end
         | 
| 105 109 |  | 
    
        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: 5.1. | 
| 4 | 
            +
              version: 5.1.5.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:  | 
| 11 | 
            +
            date: 2018-02-01 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: 5.1. | 
| 19 | 
            +
                    version: 5.1.5.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: 5.1. | 
| 26 | 
            +
                    version: 5.1.5.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.
         | 
| @@ -92,7 +92,9 @@ files: | |
| 92 92 | 
             
            homepage: http://rubyonrails.org
         | 
| 93 93 | 
             
            licenses:
         | 
| 94 94 | 
             
            - MIT
         | 
| 95 | 
            -
            metadata: | 
| 95 | 
            +
            metadata:
         | 
| 96 | 
            +
              source_code_uri: https://github.com/rails/rails/tree/v5.1.5.rc1/activemodel
         | 
| 97 | 
            +
              changelog_uri: https://github.com/rails/rails/blob/v5.1.5.rc1/activemodel/CHANGELOG.md
         | 
| 96 98 | 
             
            post_install_message: 
         | 
| 97 99 | 
             
            rdoc_options: []
         | 
| 98 100 | 
             
            require_paths:
         | 
| @@ -104,12 +106,12 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 104 106 | 
             
                  version: 2.2.2
         | 
| 105 107 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 106 108 | 
             
              requirements:
         | 
| 107 | 
            -
              - - " | 
| 109 | 
            +
              - - ">"
         | 
| 108 110 | 
             
                - !ruby/object:Gem::Version
         | 
| 109 | 
            -
                  version:  | 
| 111 | 
            +
                  version: 1.3.1
         | 
| 110 112 | 
             
            requirements: []
         | 
| 111 113 | 
             
            rubyforge_project: 
         | 
| 112 | 
            -
            rubygems_version: 2. | 
| 114 | 
            +
            rubygems_version: 2.7.3
         | 
| 113 115 | 
             
            signing_key: 
         | 
| 114 116 | 
             
            specification_version: 4
         | 
| 115 117 | 
             
            summary: A toolkit for building modeling frameworks (part of Rails).
         |