logidze 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +6 -0
- data/README.md +1 -0
- data/lib/generators/logidze/install/install_generator.rb +1 -1
- data/lib/generators/logidze/install/templates/hstore.rb.erb +3 -3
- data/lib/generators/logidze/model/model_generator.rb +1 -1
- data/lib/logidze/model.rb +7 -0
- data/lib/logidze/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: dbf55af423b22297d9d4c48f956e690b344bf18004b3974a0b8f676b1421d785
|
4
|
+
data.tar.gz: f437d9de08708218a92a56d70f69b2feec71567969a53ebc721296c44f69e98f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b172c5de15657c9f29e2cfab38cda6efacf34342a1aa886dc478fa83d7b495f7c394427960f873c5b2eb8b1ee09dcafdaff8240045b554945df40b9d36732ac
|
7
|
+
data.tar.gz: 980edce48471bb6cf87a5c20da384983cccdab61305fe445627fc16af0a1f5cee3cf218e5530b3074915089cea6e2a6375686118e1516fb686b091d5aef4667a
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 0.6.4 (2018-04-30)
|
6
|
+
|
7
|
+
- [Fixes [#70](https://github.com/palkan/logidze/issues/70)] Ignore missing (e.g. removed) columns in diffs and past versions. ([@palkan][])
|
8
|
+
|
9
|
+
This is a quick fix for a more general problem (see [#59](https://github.com/palkan/logidze/issues/59)).
|
10
|
+
|
5
11
|
## 0.6.3 (2018-01-17)
|
6
12
|
|
7
13
|
- [Fixes [#57](https://github.com/palkan/logidze/issues/57)] Support associations versioning for `at(version:)`. ([@palkan][])
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
[![Gem Version](https://badge.fury.io/rb/logidze.svg)](https://rubygems.org/gems/logidze) [![Build Status](https://travis-ci.org/palkan/logidze.svg?branch=master)](https://travis-ci.org/palkan/logidze) [![Circle CI](https://circleci.com/gh/palkan/logidze/tree/master.svg?style=svg)](https://circleci.com/gh/palkan/logidze/tree/master)
|
2
2
|
[![Dependency Status](https://dependencyci.com/github/palkan/logidze/badge)](https://dependencyci.com/github/palkan/logidze)
|
3
|
+
[![Open Source Helpers](https://www.codetriage.com/palkan/logidze/badges/users.svg)](https://www.codetriage.com/palkan/logidze)
|
3
4
|
|
4
5
|
# Logidze
|
5
6
|
|
@@ -7,7 +7,7 @@ module Logidze
|
|
7
7
|
class InstallGenerator < ::Rails::Generators::Base # :nodoc:
|
8
8
|
include Rails::Generators::Migration
|
9
9
|
|
10
|
-
source_root File.expand_path('
|
10
|
+
source_root File.expand_path('templates', __dir__)
|
11
11
|
|
12
12
|
class_option :update, type: :boolean, optional: true,
|
13
13
|
desc: "Define whether this is an update migration"
|
@@ -6,7 +6,7 @@ require "rails/generators/active_record/migration/migration_generator"
|
|
6
6
|
module Logidze
|
7
7
|
module Generators
|
8
8
|
class ModelGenerator < ::ActiveRecord::Generators::Base # :nodoc:
|
9
|
-
source_root File.expand_path('
|
9
|
+
source_root File.expand_path('templates', __dir__)
|
10
10
|
|
11
11
|
class_option :limit, type: :numeric, optional: true, desc: "Specify history size limit"
|
12
12
|
|
data/lib/logidze/model.rb
CHANGED
@@ -134,6 +134,8 @@ module Logidze
|
|
134
134
|
deserialize_changes!(v)
|
135
135
|
end
|
136
136
|
|
137
|
+
changes.delete_if { |k, _v| deleted_column?(k) }
|
138
|
+
|
137
139
|
{ "id" => id, "changes" => changes }
|
138
140
|
end
|
139
141
|
|
@@ -203,6 +205,7 @@ module Logidze
|
|
203
205
|
end
|
204
206
|
|
205
207
|
def apply_column_diff(column, value)
|
208
|
+
return if deleted_column?(column)
|
206
209
|
write_attribute column, deserialize_value(column, value)
|
207
210
|
end
|
208
211
|
|
@@ -225,6 +228,10 @@ module Logidze
|
|
225
228
|
end
|
226
229
|
end
|
227
230
|
|
231
|
+
def deleted_column?(column)
|
232
|
+
!@attributes.key?(column)
|
233
|
+
end
|
234
|
+
|
228
235
|
def deserialize_changes!(diff)
|
229
236
|
diff.each do |k, v|
|
230
237
|
v["old"] = deserialize_value(k, v["old"])
|
data/lib/logidze/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logidze
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- palkan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -254,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
254
254
|
version: '0'
|
255
255
|
requirements: []
|
256
256
|
rubyforge_project:
|
257
|
-
rubygems_version: 2.
|
257
|
+
rubygems_version: 2.7.4
|
258
258
|
signing_key:
|
259
259
|
specification_version: 4
|
260
260
|
summary: PostgreSQL JSON-based auditing
|