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 +4 -4
- data/CHANGELOG.md +18 -0
- data/lib/superstore/persistence.rb +1 -0
- data/superstore.gemspec +2 -1
- data/test/unit/persistence_test.rb +12 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af5b7a4f7df6e0232687243d560e264dcaacd2f7
|
4
|
+
data.tar.gz: ab924e212308d0b1dc27188f98c50956b40b0f5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
-
|
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.
|
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-
|
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: []
|