superstore 2.4.1 → 2.4.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d67c4ca714fea17a25c063f07f8afa5be165e084
4
- data.tar.gz: 225ecaa179c93d680697c38eb2c3f95f3970aa4a
3
+ metadata.gz: af5b7a4f7df6e0232687243d560e264dcaacd2f7
4
+ data.tar.gz: ab924e212308d0b1dc27188f98c50956b40b0f5d
5
5
  SHA512:
6
- metadata.gz: 4829d5057189c613fd5501e2c27adcdba3d12aaa45198bdc19aadf06cf7262a3787393e34a58f3d26f22d3b267fa4c3dc68e8d12e9f4548f9078f05359a0e220
7
- data.tar.gz: 106a4a274f4fdad36df79ec7b1820a1a478c0e0367aaee884380227750cdd8efecbac76ba47d5cc895cd6709cc0a0a3b2bb94be93a948edc59ae42a5c4b45b5a
6
+ metadata.gz: 1eb40fa34f43ba5646a636b967caf19daa6a0feac9077f5f41a3285422b7957a142da13b7facb8898f36a4f665211fc2b2b1672e288c69b1a18203b2356e2d78
7
+ data.tar.gz: 93d4b920deb331bf6c8173154c56222b4be68777cd0cee0ba2acacb674f0d1fe4da0ef78c51bd93e2058ea867d4285b164f2b62c596a5278f4f340ae2c6a4e3f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ # Unreleased
2
+
3
+ # 2.4.2
4
+
5
+ Released 2016-09-26.
6
+
7
+ ## Fixed
8
+
9
+ * Ensure `changed_attributes` is copied when `.becomes` is invoked (#21)
10
+
11
+ # 2.4.1
12
+
13
+ Released 2016-08-22.
14
+
15
+ ## Fixed
16
+
17
+ * Ensure that new_record is not set until before_save callbacks complete (#20)
18
+
1
19
  # 2.4.0
2
20
 
3
21
  Released 2016-08-10.
@@ -122,6 +122,7 @@ module Superstore
122
122
  def becomes(klass)
123
123
  became = klass.new
124
124
  became.instance_variable_set("@attributes", @attributes)
125
+ became.instance_variable_set("@changed_attributes", changed_attributes || {})
125
126
  became.instance_variable_set("@new_record", new_record?)
126
127
  became.instance_variable_set("@destroyed", destroyed?)
127
128
  became
data/superstore.gemspec CHANGED
@@ -2,12 +2,13 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'superstore'
5
- s.version = '2.4.1'
5
+ s.version = '2.4.2'
6
6
  s.description = 'ActiveModel-based JSONB document store'
7
7
  s.summary = 'ActiveModel for JSONB documents'
8
8
  s.authors = ['Michael Koziarski', 'Infogroup']
9
9
  s.email = 'developer@matthewhiggins.com'
10
10
  s.homepage = 'http://github.com/data-axle/superstore'
11
+ s.licenses = %w(ISC MIT)
11
12
 
12
13
  s.required_ruby_version = '>= 2.0.0'
13
14
  s.required_rubygems_version = '>= 1.3.5'
@@ -144,10 +144,21 @@ class Superstore::PersistenceTest < Superstore::TestCase
144
144
  end
145
145
 
146
146
  test 'becomes' do
147
+ klass = temp_object
148
+
149
+ assert_kind_of klass, Issue.new.becomes(klass)
150
+ end
151
+
152
+ test 'becomes includes changed_attributes' do
147
153
  klass = temp_object do
154
+ string :title
148
155
  end
149
156
 
150
- assert_kind_of klass, Issue.new.becomes(klass)
157
+ issue = Issue.new(title: 'Something is wrong')
158
+ other = issue.becomes(klass)
159
+
160
+ assert_equal 'Something is wrong', other.title
161
+ assert_equal %w(title), other.changed
151
162
  end
152
163
 
153
164
  test 'reload' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: superstore
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.1
4
+ version: 2.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Koziarski
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-08-22 00:00:00.000000000 Z
12
+ date: 2016-09-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
@@ -173,7 +173,9 @@ files:
173
173
  - test/unit/types/time_type_test.rb
174
174
  - test/unit/validations_test.rb
175
175
  homepage: http://github.com/data-axle/superstore
176
- licenses: []
176
+ licenses:
177
+ - ISC
178
+ - MIT
177
179
  metadata: {}
178
180
  post_install_message:
179
181
  rdoc_options: []