table_differ 0.6.2 → 0.6.4

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: f32849fe70818b0be853ee6ce1348076cf19b7f6
4
- data.tar.gz: e6c63922b022bfccb5f9f69f083ca81e2a36612c
3
+ metadata.gz: e3d9fc140b0f6ab8094995a54634a67f7ce9a2ff
4
+ data.tar.gz: 65d2e02bbd1a8a4208c42ac75f50e87eb1f20f60
5
5
  SHA512:
6
- metadata.gz: a825c536392d729a91d200d70c3fbfac19e9f6fe9ffb75f6f208d032f567fc2ad65a76d848a72a351cb6d4ee152a0364dcf2c35c64e32093d665ca6dd8bf1a23
7
- data.tar.gz: 6f82e4c151ba2ceabb9f25d303a7568ad5096e4cb5cbd340e89c7e72a10e0ee18025c9d001bbac063fc9a8c5485142831dba5c9e75f340cdf2cefe31ddf4d617
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
@@ -1,3 +1,3 @@
1
1
  module TableDiffer
2
- VERSION = "0.6.2"
2
+ VERSION = "0.6.4"
3
3
  end
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({"id" => nil, "name" => 'one', "original_name" => 'one', "alternate_value" => nil})
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: table_differ
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Bronson