initial-test-data 0.4.0 → 0.4.1
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 +4 -0
- data/README.md +25 -1
- data/lib/initial-test-data/utilities.rb +2 -2
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 934b819f0326ca51b103547bd4ba930e3bd89de3
         | 
| 4 | 
            +
              data.tar.gz: 12e3d2844061909c2ef2daf66896165f6321d150
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 656ca06fb2500176fb96dd6196b83ffea236a59b92b1d2c5a56e3a0b22224816c92459c2f1bf7b45f924dae488a6c00393642021c0e9851f26695087e8582a81
         | 
| 7 | 
            +
              data.tar.gz: 530bfdaa4ef45c84a331483f3cf25f8459335e134986f82fbc6e47db84771479b27089b6ca4bd188de288b881f4c1fff55399e0a2315c3730e1c06b8acfb2553
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    | @@ -116,7 +116,21 @@ RSpec.configure do |config| | |
| 116 116 | 
             
            end
         | 
| 117 117 | 
             
            ```
         | 
| 118 118 |  | 
| 119 | 
            -
             | 
| 119 | 
            +
            #### `only`
         | 
| 120 | 
            +
             | 
| 121 | 
            +
            Contrary to the `except` option, when you use this,
         | 
| 122 | 
            +
            only the specified tables are initialized:
         | 
| 123 | 
            +
             | 
| 124 | 
            +
            ```ruby
         | 
| 125 | 
            +
            RSpec.configure do |config|
         | 
| 126 | 
            +
              config.before(:suite) do
         | 
| 127 | 
            +
                InitialTestData.load('spec', only: %w(customers products))
         | 
| 128 | 
            +
              end
         | 
| 129 | 
            +
            end
         | 
| 130 | 
            +
            ```
         | 
| 131 | 
            +
             | 
| 132 | 
            +
            Note that the `except` and `only` options are used to construct
         | 
| 133 | 
            +
            the options passed to the `DatabaseCleaner.strategy=` method.
         | 
| 120 134 |  | 
| 121 135 | 
             
            #### `monitoring`
         | 
| 122 136 |  | 
| @@ -248,3 +262,13 @@ feature 'Manage customers' do | |
| 248 262 | 
             
              end
         | 
| 249 263 | 
             
            end
         | 
| 250 264 | 
             
            ```
         | 
| 265 | 
            +
             | 
| 266 | 
            +
            License
         | 
| 267 | 
            +
            -------
         | 
| 268 | 
            +
             | 
| 269 | 
            +
            The `initial-test-data` is distributed under the MIT license. ([MIT-LICENSE](https://github.com/oiax/initial-test-data/blob/master/MIT-LICENSE))
         | 
| 270 | 
            +
             | 
| 271 | 
            +
            Author
         | 
| 272 | 
            +
            ------
         | 
| 273 | 
            +
             | 
| 274 | 
            +
            Tsutomu Kuroda (t-kuroda@oiax.jp)
         | 
| @@ -2,8 +2,8 @@ require 'active_support' | |
| 2 2 |  | 
| 3 3 | 
             
            module InitialTestData
         | 
| 4 4 | 
             
              module Utilities
         | 
| 5 | 
            -
                def store(record, name)
         | 
| 6 | 
            -
                  model_name = record.class.model_name.singular
         | 
| 5 | 
            +
                def store(record, name, options = {})
         | 
| 6 | 
            +
                  model_name = options[:as] || record.class.model_name.singular
         | 
| 7 7 | 
             
                  record_name = name.to_s
         | 
| 8 8 |  | 
| 9 9 | 
             
                  RECORD_IDS[model_name] ||= HashWithIndifferentAccess.new
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: initial-test-data
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.4. | 
| 4 | 
            +
              version: 0.4.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Tsutomu KURODA
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2016-02- | 
| 11 | 
            +
            date: 2016-02-02 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: activesupport
         |