embark-journey 0.0.10 → 0.0.11
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 +3 -0
 - data/lib/journey/resource.rb +6 -2
 - data/lib/journey/version.rb +1 -1
 - data/spec/models/journey/resource_spec.rb +17 -0
 - 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: 2a1796f2ca4e14c106158d316ed0fbe3af97d618
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 5fd016e3273256d82bd48bbd476b192addf31c7c
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 8ee7e6f3e659bf9b3749a5608de9c0c6fa79dab09981bf5b7838acfb74458f511a8719fe56c4b5162d3092809942668c69a6c56b518d65f8fde967f1baf0a32b
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 7a6f543b57bc740f351cfc4e51b85d0c5fcea5d88962ea670645ab1cb2004f123279d2339ad56385f699a1aacff2896591ae64874a043e01623f76076e26ba9e
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        data/lib/journey/resource.rb
    CHANGED
    
    | 
         @@ -4,9 +4,13 @@ module Journey 
     | 
|
| 
       4 
4 
     | 
    
         
             
                def self.find(*arguments)
         
     | 
| 
       5 
5 
     | 
    
         
             
                  scope   = arguments.slice!(0)
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
     | 
    
         
            -
                  self.embeds ||= []
         
     | 
| 
       8 
7 
     | 
    
         
             
                  options = arguments.slice!(0) || {}
         
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                  self.embeds ||= []
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                  unless options.has_key?(:embed) && !options.delete(:embed)
         
     | 
| 
      
 12 
     | 
    
         
            +
                    options.deep_merge!(params: { embed: embeds })
         
     | 
| 
      
 13 
     | 
    
         
            +
                  end
         
     | 
| 
       10 
14 
     | 
    
         | 
| 
       11 
15 
     | 
    
         
             
                  super *([scope, options] + arguments)
         
     | 
| 
       12 
16 
     | 
    
         
             
                end
         
     | 
    
        data/lib/journey/version.rb
    CHANGED
    
    
| 
         @@ -126,6 +126,23 @@ describe Journey::Resource do 
     | 
|
| 
       126 
126 
     | 
    
         
             
                  expect(job.attributes['reported_fault']).to eq fault
         
     | 
| 
       127 
127 
     | 
    
         
             
                  expect(job.reported_fault).to eq fault
         
     | 
| 
       128 
128 
     | 
    
         
             
                end
         
     | 
| 
      
 129 
     | 
    
         
            +
             
     | 
| 
      
 130 
     | 
    
         
            +
                it 'skips embedded belongs_to associations when opted for' do
         
     | 
| 
      
 131 
     | 
    
         
            +
                  asset = Asset.create name: 'asset'
         
     | 
| 
      
 132 
     | 
    
         
            +
                  fault = Fault.create name: 'fault'
         
     | 
| 
      
 133 
     | 
    
         
            +
             
     | 
| 
      
 134 
     | 
    
         
            +
                  job = Job.create name: 'job', asset_id: asset.id, reported_fault_id: fault.id
         
     | 
| 
      
 135 
     | 
    
         
            +
                  id = job.id
         
     | 
| 
      
 136 
     | 
    
         
            +
                  job = Job.find(id, embed: false)
         
     | 
| 
      
 137 
     | 
    
         
            +
             
     | 
| 
      
 138 
     | 
    
         
            +
                  expect(job.attributes['asset']).to be_nil
         
     | 
| 
      
 139 
     | 
    
         
            +
                  expect(job.asset).to eq asset
         
     | 
| 
      
 140 
     | 
    
         
            +
             
     | 
| 
      
 141 
     | 
    
         
            +
                  expect(job.attributes['reported_fault']).to be_nil
         
     | 
| 
      
 142 
     | 
    
         
            +
                  expect(job.reported_fault).to eq fault
         
     | 
| 
      
 143 
     | 
    
         
            +
                end
         
     | 
| 
      
 144 
     | 
    
         
            +
             
     | 
| 
      
 145 
     | 
    
         
            +
             
     | 
| 
       129 
146 
     | 
    
         
             
              end
         
     | 
| 
       130 
147 
     | 
    
         | 
| 
       131 
148 
     | 
    
         | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: embark-journey
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.11
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Dan Davey
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2014-05- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-05-19 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: active_attr
         
     |