eac_rails_utils 0.17.2 → 0.18.0
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
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: e69ab406dd1dd999da6a2fdefa92e15ad6c1a2faeb14f0474fa7fd20938a71ef
         | 
| 4 | 
            +
              data.tar.gz: f91fdd425c80747f432acbcdd4ed80c399eed2e80f3d1e862699dbb0839d9077
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 0f772b792fb6684dfff2e450286e5f014d04e4b9c45630a8cc7d3486c9a70cb895381ba4480e973a4b2cdc4cde5a29bfa94392c8e2efc9e141a08e2ce0e126d4
         | 
| 7 | 
            +
              data.tar.gz: 2a5cc246cb003b694e2701bb70409cc7df7e2e69fc80d093a47912dbed5d50c2e1cdab740e4e9d36f29469cc84fd8bc83a50fd15f66cbda35b4ecd328093139a
         | 
| @@ -0,0 +1,14 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module EacRailsUtils
         | 
| 4 | 
            +
              class ImmutableValidator < ActiveModel::EachValidator
         | 
| 5 | 
            +
                DEFAULT_MESSAGE = 'cannot be changed'
         | 
| 6 | 
            +
             | 
| 7 | 
            +
                def validate_each(record, attribute, _value)
         | 
| 8 | 
            +
                  return if record.new_record?
         | 
| 9 | 
            +
                  return unless record.send("#{attribute}_changed?")
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                  record.errors[attribute] << (options[:message] || DEFAULT_MESSAGE)
         | 
| 12 | 
            +
                end
         | 
| 13 | 
            +
              end
         | 
| 14 | 
            +
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: eac_rails_utils
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.18.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - E.A.C.
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2023-05- | 
| 11 | 
            +
            date: 2023-05-30 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: activemodel-associations
         | 
| @@ -203,6 +203,7 @@ files: | |
| 203 203 | 
             
            - app/helpers/eac_rails_utils/menus_helper/gui_builder.rb
         | 
| 204 204 | 
             
            - app/helpers/eac_rails_utils/open_graph_protocol_helper.rb
         | 
| 205 205 | 
             
            - app/validators/eac_rails_utils/cpf_validator.rb
         | 
| 206 | 
            +
            - app/validators/eac_rails_utils/immutable_validator.rb
         | 
| 206 207 | 
             
            - app/validators/eac_rails_utils/no_presence_validator.rb
         | 
| 207 208 | 
             
            - app/validators/eac_rails_utils/yaml_validator.rb
         | 
| 208 209 | 
             
            - config/initializers/assets.rb
         |