active_guid 0.0.4 → 0.0.5
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 +15 -0
- data/README.md +22 -21
- data/lib/active_guid.rb +2 -4
- metadata +44 -31
    
        checksums.yaml
    ADDED
    
    | @@ -0,0 +1,15 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            !binary "U0hBMQ==":
         | 
| 3 | 
            +
              metadata.gz: !binary |-
         | 
| 4 | 
            +
                OGM5MDEwY2U0ZTkyZTBjM2Q4MzZmOTI1NjlkMzk1OWQyNDgwMGJkOQ==
         | 
| 5 | 
            +
              data.tar.gz: !binary |-
         | 
| 6 | 
            +
                ZTg2NDk5NjEwZGRkOTgxM2ZmM2ZhYTFjMzUxYzVkYTQyNWFmZGNkNw==
         | 
| 7 | 
            +
            SHA512:
         | 
| 8 | 
            +
              metadata.gz: !binary |-
         | 
| 9 | 
            +
                MWMxYWYyNWQ3YzcwZGQyN2NmYWQ2OTJhZDc3ZWFmZmRiMmM5YjQzMjRjOTA3
         | 
| 10 | 
            +
                YWIxYWQ5ODBiM2QwODkzYTk0NjVjOWMyNjlkODg1NTVhN2FkODQ3MDljNWU0
         | 
| 11 | 
            +
                NDI4MjE0ZmEwZWQzNjZkNjE3NjE5ODFkNjBmZDllMDAzNDhiMWY=
         | 
| 12 | 
            +
              data.tar.gz: !binary |-
         | 
| 13 | 
            +
                MWYxOGYzY2M1NTc5NWI5NmQwMGUwNDEwZTVkZTM5MDEzMTIzMzg4ZjA2NTUz
         | 
| 14 | 
            +
                YTQ1ZWIzNTQ1ZjE3OWFiYWZjODU2NzViN2VmZTg4NGE0MjJjZTQyZTJkYmYw
         | 
| 15 | 
            +
                MGQ4NzU4MGQ1MTZmZDYzOWE3MDYzNzlkZGVhZDI0MTExMTQyOTE=
         | 
    
        data/README.md
    CHANGED
    
    | @@ -1,31 +1,32 @@ | |
| 1 | 
            -
            ActiveGuid
         | 
| 2 | 
            -
            ==========
         | 
| 1 | 
            +
            # ActiveGuid
         | 
| 3 2 |  | 
| 4 3 | 
             
            Add a GUID column to Active Record instances. Useful for providing an unambiguous ID that doesn't also reveal anything about your database.
         | 
| 5 4 |  | 
| 6 5 | 
             
            There is no way to customize the column name at this time - it has to be `guid`, a string of 32 characters.
         | 
| 7 6 |  | 
| 8 | 
            -
            Requires UUIDTools ~> 2.1, Rails  | 
| 9 | 
            -
             | 
| 10 | 
            -
            Usage
         | 
| 11 | 
            -
             | 
| 12 | 
            -
             | 
| 13 | 
            -
             | 
| 14 | 
            -
             | 
| 15 | 
            -
             | 
| 16 | 
            -
             | 
| 17 | 
            -
             | 
| 18 | 
            -
             | 
| 19 | 
            -
             | 
| 20 | 
            -
             | 
| 21 | 
            -
             | 
| 22 | 
            -
             | 
| 23 | 
            -
             | 
| 24 | 
            -
             | 
| 25 | 
            -
             | 
| 7 | 
            +
            Requires UUIDTools ~> 2.1, Rails >= 3 and Ruby 1.9.2.
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            # Usage
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            ```ruby
         | 
| 12 | 
            +
            create_table :users do |t|
         | 
| 13 | 
            +
              t.string :guid, limit: 32, unique: true, null: false
         | 
| 14 | 
            +
            end
         | 
| 15 | 
            +
             | 
| 16 | 
            +
            class User < ActiveRecord::Base
         | 
| 17 | 
            +
              include ActiveGuid
         | 
| 18 | 
            +
            end
         | 
| 19 | 
            +
             | 
| 20 | 
            +
            u = User.new
         | 
| 21 | 
            +
            u.guid # => 'e5a49bdd-72a0-4e72-802a-637c22ab6507' or whatever
         | 
| 22 | 
            +
            ```
         | 
| 23 | 
            +
             | 
| 24 | 
            +
            # Changelog
         | 
| 25 | 
            +
             | 
| 26 | 
            +
            0.0.5: Allows use with Rails 4. Removed `attr_protected :guid` in favor of `strong_parameters`
         | 
| 26 27 |  | 
| 27 28 | 
             
            0.0.3: Use `default_value_for` instead of a `before_validation` callback. So the GUID will be populated when the record is instantiated and can be passed to the client before the record is saved. See [default_value_for](http://github.com/FooBarWidget/default_value_for) for more information.
         | 
| 28 29 |  | 
| 29 30 | 
             
            0.0.2: Handle situations where the default of the GUID column is "" instead of NULL
         | 
| 30 31 |  | 
| 31 | 
            -
            0.0.1: Initial release
         | 
| 32 | 
            +
            0.0.1: Initial release
         | 
    
        data/lib/active_guid.rb
    CHANGED
    
    | @@ -4,14 +4,12 @@ require 'uuidtools' | |
| 4 4 |  | 
| 5 5 | 
             
            module ActiveGuid
         | 
| 6 6 | 
             
              extend ActiveSupport::Concern
         | 
| 7 | 
            -
             | 
| 7 | 
            +
             | 
| 8 8 | 
             
              included do
         | 
| 9 | 
            -
                attr_protected :guid
         | 
| 10 | 
            -
                
         | 
| 11 9 | 
             
                default_value_for :guid do
         | 
| 12 10 | 
             
                  UUIDTools::UUID.random_create.to_s
         | 
| 13 11 | 
             
                end
         | 
| 14 | 
            -
             | 
| 12 | 
            +
             | 
| 15 13 | 
             
                validates :guid, presence: true
         | 
| 16 14 | 
             
              end
         | 
| 17 15 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,103 +1,116 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: active_guid
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 5 | 
            -
              prerelease: 
         | 
| 4 | 
            +
              version: 0.0.5
         | 
| 6 5 | 
             
            platform: ruby
         | 
| 7 6 | 
             
            authors:
         | 
| 8 7 | 
             
            - Nick Ragaz
         | 
| 9 8 | 
             
            autorequire: 
         | 
| 10 9 | 
             
            bindir: bin
         | 
| 11 10 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date:  | 
| 11 | 
            +
            date: 2014-03-05 00:00:00.000000000 Z
         | 
| 13 12 | 
             
            dependencies:
         | 
| 14 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 15 | 
            +
                requirements:
         | 
| 16 | 
            +
                - - ~>
         | 
| 17 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 18 | 
            +
                    version: '2.1'
         | 
| 19 | 
            +
              prerelease: false
         | 
| 15 20 | 
             
              name: uuidtools
         | 
| 16 | 
            -
               | 
| 17 | 
            -
                none: false
         | 
| 21 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 18 22 | 
             
                requirements:
         | 
| 19 23 | 
             
                - - ~>
         | 
| 20 24 | 
             
                  - !ruby/object:Gem::Version
         | 
| 21 25 | 
             
                    version: '2.1'
         | 
| 22 26 | 
             
              type: :runtime
         | 
| 23 | 
            -
              prerelease: false
         | 
| 24 | 
            -
              version_requirements: *70219729230240
         | 
| 25 27 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 28 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 29 | 
            +
                requirements:
         | 
| 30 | 
            +
                - - ! '>='
         | 
| 31 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 32 | 
            +
                    version: '3'
         | 
| 33 | 
            +
              prerelease: false
         | 
| 26 34 | 
             
              name: activerecord
         | 
| 27 | 
            -
               | 
| 28 | 
            -
                none: false
         | 
| 35 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 29 36 | 
             
                requirements:
         | 
| 30 | 
            -
                - -  | 
| 37 | 
            +
                - - ! '>='
         | 
| 31 38 | 
             
                  - !ruby/object:Gem::Version
         | 
| 32 39 | 
             
                    version: '3'
         | 
| 33 40 | 
             
              type: :runtime
         | 
| 34 | 
            -
              prerelease: false
         | 
| 35 | 
            -
              version_requirements: *70219729227460
         | 
| 36 41 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 42 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 43 | 
            +
                requirements:
         | 
| 44 | 
            +
                - - ! '>='
         | 
| 45 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 46 | 
            +
                    version: '3'
         | 
| 47 | 
            +
              prerelease: false
         | 
| 37 48 | 
             
              name: activesupport
         | 
| 38 | 
            -
               | 
| 39 | 
            -
                none: false
         | 
| 49 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 40 50 | 
             
                requirements:
         | 
| 41 | 
            -
                - -  | 
| 51 | 
            +
                - - ! '>='
         | 
| 42 52 | 
             
                  - !ruby/object:Gem::Version
         | 
| 43 53 | 
             
                    version: '3'
         | 
| 44 54 | 
             
              type: :runtime
         | 
| 45 | 
            -
              prerelease: false
         | 
| 46 | 
            -
              version_requirements: *70219718323140
         | 
| 47 55 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 56 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 57 | 
            +
                requirements:
         | 
| 58 | 
            +
                - - ! '>='
         | 
| 59 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 60 | 
            +
                    version: '0'
         | 
| 61 | 
            +
              prerelease: false
         | 
| 48 62 | 
             
              name: default_value_for
         | 
| 49 | 
            -
               | 
| 50 | 
            -
                none: false
         | 
| 63 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 51 64 | 
             
                requirements:
         | 
| 52 65 | 
             
                - - ! '>='
         | 
| 53 66 | 
             
                  - !ruby/object:Gem::Version
         | 
| 54 67 | 
             
                    version: '0'
         | 
| 55 68 | 
             
              type: :runtime
         | 
| 56 | 
            -
              prerelease: false
         | 
| 57 | 
            -
              version_requirements: *70219718322760
         | 
| 58 69 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 70 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 71 | 
            +
                requirements:
         | 
| 72 | 
            +
                - - ! '>='
         | 
| 73 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 74 | 
            +
                    version: '0'
         | 
| 75 | 
            +
              prerelease: false
         | 
| 59 76 | 
             
              name: sqlite3
         | 
| 60 | 
            -
               | 
| 61 | 
            -
                none: false
         | 
| 77 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 62 78 | 
             
                requirements:
         | 
| 63 79 | 
             
                - - ! '>='
         | 
| 64 80 | 
             
                  - !ruby/object:Gem::Version
         | 
| 65 81 | 
             
                    version: '0'
         | 
| 66 82 | 
             
              type: :development
         | 
| 67 | 
            -
              prerelease: false
         | 
| 68 | 
            -
              version_requirements: *70219718322300
         | 
| 69 83 | 
             
            description: Add a GUID to Active Record instances.
         | 
| 70 84 | 
             
            email: nick.ragaz@gmail.com
         | 
| 71 85 | 
             
            executables: []
         | 
| 72 86 | 
             
            extensions: []
         | 
| 73 87 | 
             
            extra_rdoc_files: []
         | 
| 74 88 | 
             
            files:
         | 
| 75 | 
            -
            - lib/active_guid.rb
         | 
| 76 89 | 
             
            - MIT-LICENSE
         | 
| 77 | 
            -
            - Rakefile
         | 
| 78 90 | 
             
            - README.md
         | 
| 91 | 
            +
            - Rakefile
         | 
| 92 | 
            +
            - lib/active_guid.rb
         | 
| 79 93 | 
             
            homepage: http://github.com/nragaz/active_guid
         | 
| 80 94 | 
             
            licenses: []
         | 
| 95 | 
            +
            metadata: {}
         | 
| 81 96 | 
             
            post_install_message: 
         | 
| 82 97 | 
             
            rdoc_options: []
         | 
| 83 98 | 
             
            require_paths:
         | 
| 84 99 | 
             
            - lib
         | 
| 85 100 | 
             
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 86 | 
            -
              none: false
         | 
| 87 101 | 
             
              requirements:
         | 
| 88 102 | 
             
              - - ! '>='
         | 
| 89 103 | 
             
                - !ruby/object:Gem::Version
         | 
| 90 104 | 
             
                  version: '0'
         | 
| 91 105 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 92 | 
            -
              none: false
         | 
| 93 106 | 
             
              requirements:
         | 
| 94 107 | 
             
              - - ! '>='
         | 
| 95 108 | 
             
                - !ruby/object:Gem::Version
         | 
| 96 109 | 
             
                  version: '0'
         | 
| 97 110 | 
             
            requirements: []
         | 
| 98 111 | 
             
            rubyforge_project: 
         | 
| 99 | 
            -
            rubygems_version:  | 
| 112 | 
            +
            rubygems_version: 2.2.1
         | 
| 100 113 | 
             
            signing_key: 
         | 
| 101 | 
            -
            specification_version:  | 
| 114 | 
            +
            specification_version: 4
         | 
| 102 115 | 
             
            summary: Add a GUID to Active Record instances.
         | 
| 103 116 | 
             
            test_files: []
         |