praxis-mapper 3.1.1 → 3.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7bb0361a7b29be6d0c9d393bf149369d22cfacd1
4
- data.tar.gz: f86867db4ccfdd60992aab8cc66cf8959362c7ec
3
+ metadata.gz: 71bd06fa8f2c3ff667aef12cf116a714c17c76fa
4
+ data.tar.gz: 3ab68cf2cdf25df7fe6ba341a459b3c0047fc1e1
5
5
  SHA512:
6
- metadata.gz: 13f27e05d0c46b6ed3b906af2fbee4e05425530354ee873eba1097beeacb4df74955b9aa05e064f1ce1165fdda9f72b74beb4c5759454c4493d086c9ffea98d6
7
- data.tar.gz: 697c2552d6c1b898df1d77e61e164f844d89361f66a5647ccac2005e745e7ccf7bc7d06acfaf066700d00e19af1f771ed8512f79672e786d0c90fdb9b023dbcb
6
+ metadata.gz: 19cb0ef80ba71a29fc8674ed6278cdc3c9e3336504698117818e3c856a3fb1e0cdfa5b5f4c4850e84c95cda2ed57a204b99709fc7113b9f3e0dfbe68a57e191a
7
+ data.tar.gz: 66b34d0b5c243c2ac1f092f041bc68995bc5a200b30d3e0ad3ed269213108548b8e5ce7947eaeb46f327be443fd5c0b76045467e70c58da1d95e9ecce10aa5ec
@@ -2,7 +2,12 @@
2
2
 
3
3
  ## next
4
4
 
5
- * Next feature description here
5
+ * Next feature or fix here.
6
+
7
+ ## 3.1.2
8
+
9
+ * Fixed handling of loads where :staged, which could cause an incorrect underlying query using a "staged" column.
10
+ * Relaxed ActiveSupport version dependency from 4 to >=3
6
11
 
7
12
  ## 3.1
8
13
 
data/README.md CHANGED
@@ -1,4 +1,8 @@
1
- # Praxis::Mapper
1
+ # Praxis::Mapper [![TravisCI][travis-img-url]][travis-ci-url]
2
+
3
+ [travis-img-url]:https://travis-ci.org/rightscale/praxis-mapper.svg?branch=master
4
+ [travis-ci-url]:https://travis-ci.org/rightscale/praxis-mapper
5
+
2
6
 
3
7
  Praxis::Mapper is a library that allows for large amounts of data to be loaded for a tree of associated models,
4
8
  while minimizing requests to external services.
data/Rakefile CHANGED
@@ -2,6 +2,7 @@ require 'bundler/setup'
2
2
 
3
3
  require 'rspec/core'
4
4
  require 'rspec/core/rake_task'
5
+ require 'bundler/gem_tasks'
5
6
 
6
7
  desc "Run RSpec code examples with simplecov"
7
8
  RSpec::Core::RakeTask.new do |spec|
@@ -113,7 +113,10 @@ module Praxis::Mapper
113
113
  query_class = @connection_manager.repository(model.repository_name)[:query]
114
114
  query = query_class.new(self, model, &block)
115
115
 
116
- return finalize_model!(model, query) if query.where == :staged
116
+ if query.where == :staged
117
+ query.where = nil
118
+ return finalize_model!(model, query)
119
+ end
117
120
 
118
121
  records = query.execute
119
122
  add_records(records)
@@ -1,5 +1,5 @@
1
1
  module Praxis
2
2
  module Mapper
3
- VERSION = "3.1.1"
3
+ VERSION = "3.1.2"
4
4
  end
5
5
  end
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.add_runtime_dependency(%q<randexp>, ["~> 0"])
23
23
  spec.add_runtime_dependency(%q<sequel>, ["~> 4"])
24
- spec.add_runtime_dependency(%q<activesupport>, ["~> 4"])
24
+ spec.add_runtime_dependency(%q<activesupport>, [">= 3"])
25
25
 
26
26
  spec.add_development_dependency "bundler", "~> 1.6"
27
27
  spec.add_development_dependency "rake", "~> 0"
@@ -108,6 +108,25 @@ describe Praxis::Mapper::IdentityMap do
108
108
 
109
109
  end
110
110
 
111
+ context 'where :staged' do
112
+ after do
113
+ identity_map.load AddressModel do
114
+ where :staged
115
+ track :foobar
116
+ end
117
+ end
118
+ it 'calls finalize_model!' do
119
+ identity_map.should_receive(:finalize_model!).with(AddressModel, anything())
120
+ end
121
+ it 'removes the :staged from the query where clause' do
122
+ identity_map.should_receive(:finalize_model!) do |model, query|
123
+ model.should be(AddressModel)
124
+ query.where.should be(nil)
125
+ query.track.should eq(Set.new([:foobar]))
126
+ end
127
+ end
128
+ end
129
+
111
130
  context 'with a query with a subload' do
112
131
  context 'for a many_to_one association' do
113
132
  before do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: praxis-mapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep M. Blanquer
@@ -43,16 +43,16 @@ dependencies:
43
43
  name: activesupport
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - "~>"
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: '4'
48
+ version: '3'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - "~>"
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: '4'
55
+ version: '3'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: bundler
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -220,7 +220,6 @@ files:
220
220
  - ".travis.yml"
221
221
  - CHANGELOG.md
222
222
  - Gemfile
223
- - Gemfile.lock
224
223
  - Guardfile
225
224
  - LICENSE
226
225
  - README.md
@@ -277,7 +276,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
277
276
  version: '0'
278
277
  requirements: []
279
278
  rubyforge_project:
280
- rubygems_version: 2.2.1
279
+ rubygems_version: 2.2.2
281
280
  signing_key:
282
281
  specification_version: 4
283
282
  summary: A multi-datastore library designed for efficiency in loading large datasets.
@@ -1,102 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- praxis-mapper (3.1.0)
5
- activesupport (~> 4)
6
- randexp (~> 0)
7
- sequel (~> 4)
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- activesupport (4.1.5)
13
- i18n (~> 0.6, >= 0.6.9)
14
- json (~> 1.7, >= 1.7.7)
15
- minitest (~> 5.1)
16
- thread_safe (~> 0.1)
17
- tzinfo (~> 1.1)
18
- binding_of_caller (0.7.2)
19
- debug_inspector (>= 0.0.1)
20
- byebug (2.7.0)
21
- columnize (~> 0.3)
22
- debugger-linecache (~> 1.2)
23
- celluloid (0.15.2)
24
- timers (~> 1.1.0)
25
- coderay (1.1.0)
26
- columnize (0.8.9)
27
- debug_inspector (0.0.2)
28
- debugger-linecache (1.2.0)
29
- diff-lcs (1.2.5)
30
- ffi (1.9.3)
31
- formatador (0.2.5)
32
- fuubar (1.3.3)
33
- rspec (>= 2.14.0, < 3.1.0)
34
- ruby-progressbar (~> 1.4)
35
- guard (2.6.1)
36
- formatador (>= 0.2.4)
37
- listen (~> 2.7)
38
- lumberjack (~> 1.0)
39
- pry (>= 0.9.12)
40
- thor (>= 0.18.1)
41
- guard-rspec (4.3.1)
42
- guard (~> 2.1)
43
- rspec (>= 2.14, < 4.0)
44
- i18n (0.6.11)
45
- json (1.8.1)
46
- listen (2.7.9)
47
- celluloid (>= 0.15.2)
48
- rb-fsevent (>= 0.9.3)
49
- rb-inotify (>= 0.9)
50
- lumberjack (1.0.9)
51
- method_source (0.8.2)
52
- minitest (5.4.0)
53
- pry (0.10.1)
54
- coderay (~> 1.1.0)
55
- method_source (~> 0.8.1)
56
- slop (~> 3.4)
57
- pry-byebug (1.3.3)
58
- byebug (~> 2.7)
59
- pry (~> 0.10)
60
- pry-stack_explorer (0.4.9.1)
61
- binding_of_caller (>= 0.7)
62
- pry (>= 0.9.11)
63
- rake (0.9.6)
64
- randexp (0.1.7)
65
- rb-fsevent (0.9.4)
66
- rb-inotify (0.9.5)
67
- ffi (>= 0.5.0)
68
- redcarpet (2.3.0)
69
- rspec (2.14.1)
70
- rspec-core (~> 2.14.0)
71
- rspec-expectations (~> 2.14.0)
72
- rspec-mocks (~> 2.14.0)
73
- rspec-core (2.14.8)
74
- rspec-expectations (2.14.5)
75
- diff-lcs (>= 1.1.3, < 2.0)
76
- rspec-mocks (2.14.6)
77
- ruby-progressbar (1.5.1)
78
- sequel (4.13.0)
79
- slop (3.6.0)
80
- thor (0.19.1)
81
- thread_safe (0.3.4)
82
- timers (1.1.0)
83
- tzinfo (1.2.2)
84
- thread_safe (~> 0.1)
85
- yard (0.8.7.4)
86
-
87
- PLATFORMS
88
- ruby
89
-
90
- DEPENDENCIES
91
- bundler (~> 1.6)
92
- fuubar (~> 1)
93
- guard (~> 2)
94
- guard-rspec
95
- praxis-mapper!
96
- pry (~> 0)
97
- pry-byebug (~> 1)
98
- pry-stack_explorer (~> 0)
99
- rake (~> 0)
100
- redcarpet (< 3.0)
101
- rspec (< 2.99)
102
- yard (~> 0.8.7)