dynamini 2.7.3 → 2.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dynamini.gemspec +1 -1
- data/lib/dynamini/attributes.rb +5 -3
- data/spec/dynamini/attributes_spec.rb +4 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 145853bc6f09042cd135919cb52a8f9c096f7e29
|
4
|
+
data.tar.gz: a1887a7aaf02775dee6a909d59f48fdf269ccb15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5767ba0bf1bf20f674782f208a27e78c7d3dbdcbd17fff55ee3c086c1173362782d90dbe0ddf56f222c80c271bb9b5c1472f916b7f7ba1cc7f62b7cd84924dd6
|
7
|
+
data.tar.gz: fb39fb5e7692b117608059020523de9174945897e4555db2b90d5b90591ea056380ea126bedef554073db14a6a73cd9ad6f75ae0bc059161cf6d327c45a542c4
|
data/dynamini.gemspec
CHANGED
data/lib/dynamini/attributes.rb
CHANGED
@@ -37,9 +37,11 @@ module Dynamini
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def delete_attribute(attribute)
|
40
|
-
|
41
|
-
|
42
|
-
|
40
|
+
if @attributes[attribute]
|
41
|
+
old_value = read_attribute(attribute)
|
42
|
+
record_change(attribute, old_value, DELETED_TOKEN, 'DELETE')
|
43
|
+
@attributes.delete(attribute)
|
44
|
+
end
|
43
45
|
end
|
44
46
|
|
45
47
|
def delete_attribute!(attribute)
|
@@ -139,14 +139,15 @@ describe Dynamini::Attributes do
|
|
139
139
|
end
|
140
140
|
|
141
141
|
it 'should remove the attribute from the in-memory attributes' do
|
142
|
-
model.delete_attribute(
|
142
|
+
model.delete_attribute(:stuff)
|
143
143
|
expect(model.attributes.keys).to_not include('stuff')
|
144
144
|
end
|
145
145
|
end
|
146
146
|
|
147
147
|
context 'the attribute does not exist' do
|
148
|
-
it 'does
|
149
|
-
model.delete_attribute(
|
148
|
+
it 'does not enqueue a change' do
|
149
|
+
model.delete_attribute(:nonexistent)
|
150
|
+
expect(model.changes.keys).to_not include('nonexistent')
|
150
151
|
end
|
151
152
|
end
|
152
153
|
end
|