audited-serialize 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f1764964d7c63fd745b4b25b2fa88067b310992a286f3a380c2b41a2009915d
|
4
|
+
data.tar.gz: 538a27e2bd456181bd64408504e416e4cfea91031e8c2469e347aedab6046106
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c1c4bd89a5ab831c1a777749f17af3236cd65f07eed3a5a89e4d790f3e81373b4dd99d89d2111ef4155942fc24955fbe9838c8db7d0bfae96a97ed414f8edb5
|
7
|
+
data.tar.gz: 90bfe8faf1dcdcc9516052fcb1e8d49d0cd575be3bac8df1eab66313ecf3ad9eca0e8725abdb0da2895ea9fbfa29930ee1f20acebe0b03157f1be26e60b740dd
|
@@ -37,6 +37,16 @@ module Audited
|
|
37
37
|
"#{operation} #{entity}"
|
38
38
|
end
|
39
39
|
|
40
|
+
def self.models_list
|
41
|
+
Rails.application.eager_load!
|
42
|
+
|
43
|
+
ActiveRecord::Base.descendants.map do |model|
|
44
|
+
if model.respond_to?(:auditing_enabled)
|
45
|
+
model.to_s
|
46
|
+
end
|
47
|
+
end.compact.sort
|
48
|
+
end
|
49
|
+
|
40
50
|
end
|
41
51
|
|
42
52
|
@ignored_attributes = %w[
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'rake'
|
2
|
+
|
3
|
+
namespace :audited do
|
4
|
+
|
5
|
+
desc 'Поиск недостающих переводов названий сущностей'
|
6
|
+
task find_missing_translations: :environment do
|
7
|
+
missing = []
|
8
|
+
|
9
|
+
# модели, на которых включены аудит-логи
|
10
|
+
audited_models = Audited::Audit.models_list
|
11
|
+
|
12
|
+
# содержимое файла с переводами
|
13
|
+
content = YAML.load_file('config/locales/audited_serialize.ru.yml')
|
14
|
+
types_in_file = content['ru']['audited_serialize']['auditable_types']
|
15
|
+
|
16
|
+
# модели с пустыми переводами
|
17
|
+
missing += types_in_file.map { |model, translation| model if translation.blank? }.compact
|
18
|
+
|
19
|
+
# недостающие модели
|
20
|
+
missing += audited_models - types_in_file.keys
|
21
|
+
|
22
|
+
if missing.empty?
|
23
|
+
abort('Все модели переведены')
|
24
|
+
else
|
25
|
+
$stdout.puts 'Недостающие переводы моделей:'
|
26
|
+
end
|
27
|
+
|
28
|
+
missing.sort.each do |model|
|
29
|
+
$stdout.puts %(#{model}: "")
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
data/lib/audited_serialize.rb
CHANGED
@@ -8,18 +8,6 @@ module Audited
|
|
8
8
|
template 'locale.rb', File.join('config/locales/audited_serialize.ru.yml')
|
9
9
|
end
|
10
10
|
|
11
|
-
private
|
12
|
-
|
13
|
-
def models
|
14
|
-
Rails.application.eager_load!
|
15
|
-
|
16
|
-
ActiveRecord::Base.descendants.map do |model|
|
17
|
-
if model.respond_to?(:auditing_enabled)
|
18
|
-
model.to_s
|
19
|
-
end
|
20
|
-
end.compact.sort
|
21
|
-
end
|
22
|
-
|
23
11
|
end
|
24
12
|
end
|
25
13
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: audited-serialize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Павел Бабин
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-04-
|
11
|
+
date: 2024-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -48,6 +48,7 @@ files:
|
|
48
48
|
- lib/audited-serialize.rb
|
49
49
|
- lib/audited/audit_extensions.rb
|
50
50
|
- lib/audited/locale/ru.yml
|
51
|
+
- lib/audited/rake_tasks.rb
|
51
52
|
- lib/audited/serialization.rb
|
52
53
|
- lib/audited/serialization_changes/array_module.rb
|
53
54
|
- lib/audited/serialization_changes/boolean_module.rb
|