materialist 2.3.0 → 2.3.1

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: 742d36bce66476aa11b5a36399c4fcdb7b6d4b48
4
- data.tar.gz: 8f22cc1e86242ca63fd87145d5cbbd57b56f889c
3
+ metadata.gz: 4a5fb544fa815aa0d48535edb7ebb25bc6763477
4
+ data.tar.gz: d3d505b4e193b8286a8a5f9b889d768a2aab197f
5
5
  SHA512:
6
- metadata.gz: 37148508f6fb84debd7e0975462164ba71f98855299fb8d9aa9f09eef7aba38dd21d5ddacf10bfbbb9496eb51204860f30ced33127c727c11e1c152c9d14ad8a
7
- data.tar.gz: 4930c84c558fcb9d5fcc89353d4f4098d39958cbbe25bc4e811a9e1c9e3cc7b4f75143185f2d81246fd4417f6fdbd9f110f35aa228f92b731cd010586253fed7
6
+ metadata.gz: c4725e268051a7e8a95e45922d9c6b55c332ab362d8bdd6ffaa9fd5656bb19dd8996ab563b8093a028cff268ff302dac41ec8697bc83a22005416ee40e4327d1
7
+ data.tar.gz: c8d683122d2671a8667283eacd95c806d31be3136d793a7d131ca7c222c0ad244235f8d8c6c03c322ccb6cc21393b842d3c0d06452a97f904f817c4c360fcce3
data/RELEASE_NOTES.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 2.3.1
2
+
3
+ Fixes:
4
+ - Fix issue with double `save` in upsert (#32)
5
+
1
6
  ## 2.3.0
2
7
 
3
8
  Features:
@@ -152,8 +152,7 @@ module Materialist
152
152
  def upsert_record
153
153
  model_class.find_or_initialize_by(source_lookup(url)).tap do |entity|
154
154
  send_messages(before_upsert, entity) unless before_upsert.nil?
155
- entity.update_attributes attributes
156
- entity.save!
155
+ entity.update_attributes! attributes
157
156
  end
158
157
  end
159
158
 
data/lib/materialist.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Materialist
2
- VERSION = '2.3.0'
2
+ VERSION = '2.3.1'
3
3
  end
@@ -51,8 +51,9 @@ RSpec.describe Materialist::Materializer do
51
51
 
52
52
  # this class mocks active record behaviour
53
53
  class BaseModel
54
- def update_attributes(attrs)
54
+ def update_attributes!(attrs)
55
55
  attrs.each { |k, v| send("#{k}=", v) }
56
+ save!
56
57
  end
57
58
 
58
59
  def save!
@@ -103,8 +104,7 @@ RSpec.describe Materialist::Materializer do
103
104
 
104
105
  def create!(attrs)
105
106
  new.tap do |record|
106
- record.update_attributes attrs
107
- record.save!
107
+ record.update_attributes! attrs
108
108
  end
109
109
  end
110
110
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: materialist
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mo Valipour
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-07 00:00:00.000000000 Z
11
+ date: 2018-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq