table_differ 0.6.2 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/table_differ/version.rb +1 -1
- data/lib/table_differ.rb +1 -1
- data/spec/remap_spec.rb +1 -1
- 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: e3d9fc140b0f6ab8094995a54634a67f7ce9a2ff
|
4
|
+
data.tar.gz: 65d2e02bbd1a8a4208c42ac75f50e87eb1f20f60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bac95e5354c1d0670121ba1f39b2c77bee513b6a71ef9108c38325bbe17b6110d4d5213a524f984820716e3a452b6a9a1767a5b4cd71cb329914c5d9adb07b9
|
7
|
+
data.tar.gz: 0d61ed3de40746e6083a52551594c541fbbb97f8c87d6aa044df670a8e55820111e0e7b45db2929843c040284111d70176d51d75ff5e02e02b21770775e7439d
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Table Differ Changelog
|
2
2
|
|
3
|
+
**0.6.0** 2 July 2014
|
4
|
+
|
5
|
+
* Added the `unique_by` option to discover changes even when ignoring the primary key.
|
6
|
+
* original_attributes now contains all original attributes, not just the changed ones.
|
7
|
+
* Added the ability to delete all snapshots: `delete_snapshots(:all)`
|
8
|
+
|
3
9
|
**0.5.0** 26 June 2014
|
4
10
|
|
5
11
|
* First public release
|
data/lib/table_differ/version.rb
CHANGED
data/lib/table_differ.rb
CHANGED
@@ -98,7 +98,7 @@ module TableDiffer
|
|
98
98
|
changed.each do |obj|
|
99
99
|
orig = removed.find { |r| r == obj }
|
100
100
|
raise "this is impossible" if orig.nil?
|
101
|
-
obj.original_attributes = orig.original_attributes || orig.attributes
|
101
|
+
obj.original_attributes = (orig.original_attributes || orig.attributes).except(*ignore)
|
102
102
|
end
|
103
103
|
|
104
104
|
added -= changed
|
data/spec/remap_spec.rb
CHANGED
@@ -20,7 +20,7 @@ describe "diffing a model" do
|
|
20
20
|
expect(removed.first.original_attributes).to eq nil
|
21
21
|
expect(changed).to eq [first]
|
22
22
|
expect(changed.first.name).to eq 'uno'
|
23
|
-
expect(changed.first.original_attributes).to eq({"
|
23
|
+
expect(changed.first.original_attributes).to eq({"name" => 'one', "original_name" => 'one', "alternate_value" => nil})
|
24
24
|
end
|
25
25
|
|
26
26
|
it "detects a changed field using a composite surrogate" do
|