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 +4 -4
- data/RELEASE_NOTES.md +5 -0
- data/lib/materialist/materializer.rb +1 -2
- data/lib/materialist.rb +1 -1
- data/spec/materialist/materializer_spec.rb +3 -3
- 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: 4a5fb544fa815aa0d48535edb7ebb25bc6763477
|
4
|
+
data.tar.gz: d3d505b4e193b8286a8a5f9b889d768a2aab197f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4725e268051a7e8a95e45922d9c6b55c332ab362d8bdd6ffaa9fd5656bb19dd8996ab563b8093a028cff268ff302dac41ec8697bc83a22005416ee40e4327d1
|
7
|
+
data.tar.gz: c8d683122d2671a8667283eacd95c806d31be3136d793a7d131ca7c222c0ad244235f8d8c6c03c322ccb6cc21393b842d3c0d06452a97f904f817c4c360fcce3
|
data/RELEASE_NOTES.md
CHANGED
@@ -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
@@ -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.
|
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:
|
11
|
+
date: 2018-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|