rails_audit 1.0.0 → 1.0.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 +4 -4
- data/LICENSE +20 -165
- data/README.md +17 -5
- data/app/controllers/auditor/admin/approvals_controller.rb +44 -0
- data/app/controllers/auditor/admin/audits_controller.rb +11 -0
- data/app/controllers/auditor/admin/base_controller.rb +4 -0
- data/app/controllers/auditor/admin/verifications_controller.rb +61 -0
- data/app/controllers/auditor/admin/verifiers_controller.rb +69 -0
- data/app/controllers/auditor/controller/application.rb +32 -0
- data/app/models/auditor/approval.rb +5 -0
- data/app/models/auditor/audit.rb +5 -0
- data/app/models/auditor/ext/audited.rb +58 -0
- data/app/models/auditor/ext/verifiable.rb +10 -0
- data/app/models/auditor/ext/verified.rb +25 -0
- data/app/models/auditor/model/approval.rb +59 -0
- data/app/models/auditor/model/approving.rb +65 -0
- data/app/models/auditor/model/audit.rb +25 -0
- data/app/models/auditor/model/verification.rb +32 -0
- data/app/models/auditor/model/verifier.rb +20 -0
- data/app/models/auditor/verification.rb +5 -0
- data/app/models/auditor/verifier.rb +5 -0
- data/app/models/auditor.rb +11 -0
- data/app/views/auditor/_approvals.html.erb +14 -0
- data/app/views/auditor/_checks.html.erb +16 -0
- data/app/views/auditor/admin/approvals/_filter.html.erb +7 -0
- data/app/views/auditor/admin/approvals/_form.html.erb +6 -0
- data/app/views/auditor/admin/approvals/_index.html.erb +10 -0
- data/app/views/auditor/admin/approvals/_show_table.html.erb +28 -0
- data/app/views/auditor/admin/approvals/_table.html.erb +28 -0
- data/app/views/auditor/admin/approvals/index.js.erb +3 -0
- data/app/views/auditor/admin/audits/_button.html.erb +0 -0
- data/app/views/auditor/admin/audits/_index_tbody.html.erb +38 -0
- data/app/views/auditor/admin/audits/_index_thead.html.erb +4 -0
- data/app/views/auditor/admin/audits/index.html.erb +7 -0
- data/app/views/auditor/admin/verifications/_edit_form.html.erb +7 -0
- data/app/views/auditor/admin/verifications/_filter_form.html.erb +5 -0
- data/app/views/auditor/admin/verifications/_index_tbody.html.erb +4 -0
- data/app/views/auditor/admin/verifications/_index_thead.html.erb +5 -0
- data/app/views/auditor/admin/verifications/_new_form.html.erb +7 -0
- data/app/views/auditor/admin/verifications/_show_table.html.erb +16 -0
- data/app/views/auditor/admin/verifiers/_edit_form.html.erb +3 -0
- data/app/views/auditor/admin/verifiers/_filter_form.html.erb +9 -0
- data/app/views/auditor/admin/verifiers/_form.html.erb +5 -0
- data/app/views/auditor/admin/verifiers/_index_tbody.html.erb +3 -0
- data/app/views/auditor/admin/verifiers/_index_thead.html.erb +4 -0
- data/app/views/auditor/admin/verifiers/_member_field.html.erb +1 -0
- data/app/views/auditor/admin/verifiers/_new_form.html.erb +3 -0
- data/app/views/auditor/admin/verifiers/_show_table.html.erb +24 -0
- data/app/views/auditor/admin/verifiers/members.turbo_stream.erb +3 -0
- data/config/locales/en.yml +12 -0
- data/config/locales/zh.controller.yml +13 -0
- data/config/locales/zh.enum.yml +7 -0
- data/config/locales/zh.yml +21 -0
- data/config/routes.rb +22 -2
- data/lib/rails_audit/config.rb +14 -0
- data/lib/rails_audit/engine.rb +15 -6
- data/lib/rails_audit.rb +3 -2
- data/test/controllers/audit/admin/approvals_controller_test.rb +36 -0
- data/test/dummy/Gemfile +54 -0
- data/test/dummy/Gemfile.lock +382 -0
- data/test/dummy/README.md +8 -1
- data/test/dummy/app/assets/images/default_avatar.jpg +0 -0
- data/test/dummy/app/assets/images/logo.png +0 -0
- data/test/dummy/app/assets/javascripts/admin/application.js +1 -0
- data/test/dummy/app/assets/javascripts/application.js +11 -2
- data/test/dummy/app/assets/javascripts/phone.js +5 -0
- data/test/dummy/app/assets/stylesheets/css.scss +4 -0
- data/test/dummy/app/controllers/active_storage/base_controller.rb +19 -0
- data/test/dummy/app/controllers/admin_controller.rb +3 -0
- data/test/dummy/app/controllers/application_controller.rb +10 -1
- data/test/dummy/app/controllers/home_controller.rb +0 -5
- data/test/dummy/app/controllers/me_controller.rb +4 -0
- data/test/dummy/app/controllers/my_controller.rb +4 -0
- data/test/dummy/app/models/auth/user.rb +7 -0
- data/test/dummy/app/views/home/index.css +3 -0
- data/test/dummy/app/views/home/index.html.erb +0 -0
- data/test/dummy/app/views/layouts/_right_menu.html.erb +0 -20
- data/test/dummy/bin/bundle +1 -1
- data/test/dummy/bin/setup +1 -1
- data/test/dummy/bin/vite +19 -0
- data/test/dummy/bin/yarn +11 -0
- data/test/dummy/config/application.rb +12 -5
- data/test/dummy/config/boot.rb +8 -4
- data/test/dummy/config/credentials/development.key +1 -0
- data/test/dummy/config/credentials/test.key +1 -0
- data/test/dummy/config/credentials.yml.enc +1 -0
- data/test/dummy/config/database.yml +16 -0
- data/test/dummy/config/environment.rb +0 -2
- data/test/dummy/config/environments/development.rb +19 -32
- data/test/dummy/config/environments/production.rb +1 -13
- data/test/dummy/config/environments/test.rb +5 -0
- data/test/dummy/config/initializers/mime_types.rb +0 -4
- data/test/dummy/config/initializers/new_framework_defaults.rb +0 -4
- data/test/dummy/config/locales/en.yml +1 -22
- data/test/dummy/config/master.key +1 -0
- data/test/dummy/config/puma.rb +28 -41
- data/test/dummy/config/routes.rb +9 -2
- data/test/dummy/config/storage.yml +11 -0
- data/test/dummy/config/vite/base.js +5 -0
- data/test/dummy/config/vite/development.js +12 -0
- data/test/dummy/config/vite/production.js +6 -0
- data/test/dummy/config.ru +2 -0
- data/test/dummy/lib/deploy.rb +115 -0
- data/test/dummy/package.json +23 -2
- data/test/dummy/postcss.config.js +11 -0
- data/test/dummy/yarn.lock +2140 -4
- data/test/factories/approvals.rb +7 -0
- data/test/factories/infos.rb +8 -0
- data/test/{the_audit_test.rb → rails_audit_test.rb} +3 -1
- data/test/test_helper.rb +9 -16
- metadata +151 -97
- data/app/controllers/admin/audits_controller.rb +0 -12
- data/app/models/rails_audit/audit.rb +0 -14
- data/app/models/rails_audit/concerns/auditable.rb +0 -59
- data/app/models/rails_audit/history.rb +0 -36
- data/app/models/rails_audit/major_record.rb +0 -14
- data/app/models/rails_audit/minor_record.rb +0 -15
- data/app/views/admin/audits/_index.html.erb +0 -9
- data/app/views/admin/audits/_table.html.erb +0 -61
- data/app/views/admin/audits/index.html.erb +0 -3
- data/app/views/admin/audits/index.js.erb +0 -8
- data/db/migrate/20170314035239_create_audits.rb +0 -20
- data/lib/rails_audit/controller_helper.rb +0 -39
- data/lib/rails_audit/version.rb +0 -3
- data/lib/tasks/the_history_tasks.rake +0 -4
- data/test/dummy/app/assets/config/manifest.js +0 -3
- data/test/dummy/app/assets/javascripts/cable.js +0 -13
- data/test/dummy/app/assets/stylesheets/application.css +0 -5
- data/test/dummy/app/controllers/admin/base_controller.rb +0 -7
- data/test/dummy/app/controllers/my/base_controller.rb +0 -7
- data/test/dummy/app/models/application_record.rb +0 -3
- data/test/dummy/app/models/user.rb +0 -3
- data/test/dummy/app/views/layouts/_navbar.html.erb +0 -18
- data/test/dummy/app/views/layouts/application.html.erb +0 -19
- data/test/dummy/app/views/layouts/mailer.html.erb +0 -13
- data/test/dummy/app/views/layouts/mailer.text.erb +0 -1
- data/test/dummy/bin/update +0 -29
- data/test/dummy/config/database.yml.mysql +0 -14
- data/test/dummy/config/database.yml.sqlite3 +0 -12
- data/test/dummy/config/initializers/assets.rb +0 -6
- data/test/dummy/config/secrets.yml +0 -22
- data/test/dummy/db/migrate/20180525090830_create_active_storage_tables.active_storage.rb +0 -26
- data/test/dummy/log/development.log +0 -2
data/test/test_helper.rb
CHANGED
@@ -1,20 +1,13 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
ENV['RAILS_ENV'] = 'test'
|
2
|
+
require_relative 'dummy/config/environment'
|
3
|
+
require 'rails/test_help'
|
4
|
+
require 'minitest/mock'
|
5
|
+
require 'factory_bot'
|
3
6
|
|
4
|
-
require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
|
5
|
-
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)]
|
6
|
-
require "rails/test_help"
|
7
|
-
|
8
|
-
# Filter out Minitest backtrace while allowing backtrace from other libraries
|
9
|
-
# to be shown.
|
10
7
|
Minitest.backtrace_filter = Minitest::BacktraceFilter.new
|
8
|
+
FactoryBot.find_definitions
|
11
9
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
# Load fixtures from the engine
|
16
|
-
if ActiveSupport::TestCase.respond_to?(:fixture_path=)
|
17
|
-
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
|
18
|
-
ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
|
19
|
-
ActiveSupport::TestCase.fixtures :all
|
10
|
+
class ActiveSupport::TestCase
|
11
|
+
include FactoryBot::Syntax::Methods
|
12
|
+
self.file_fixture_path = File.expand_path('fixtures/files', __dir__)
|
20
13
|
end
|
metadata
CHANGED
@@ -1,35 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_audit
|
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
|
- qinmingyuan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: rails_com
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
20
|
-
- - "<="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '6.0'
|
19
|
+
version: '1.2'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
|
-
- - "
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '5.0'
|
30
|
-
- - "<="
|
24
|
+
- - "~>"
|
31
25
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
26
|
+
version: '1.2'
|
33
27
|
description: Description of RailsAudit.
|
34
28
|
email:
|
35
29
|
- mingyuan0715@foxmail.com
|
@@ -40,62 +34,105 @@ files:
|
|
40
34
|
- LICENSE
|
41
35
|
- README.md
|
42
36
|
- Rakefile
|
43
|
-
- app/controllers/admin/
|
44
|
-
- app/
|
45
|
-
- app/
|
46
|
-
- app/
|
47
|
-
- app/
|
48
|
-
- app/
|
49
|
-
- app/
|
50
|
-
- app/
|
51
|
-
- app/
|
52
|
-
- app/
|
37
|
+
- app/controllers/auditor/admin/approvals_controller.rb
|
38
|
+
- app/controllers/auditor/admin/audits_controller.rb
|
39
|
+
- app/controllers/auditor/admin/base_controller.rb
|
40
|
+
- app/controllers/auditor/admin/verifications_controller.rb
|
41
|
+
- app/controllers/auditor/admin/verifiers_controller.rb
|
42
|
+
- app/controllers/auditor/controller/application.rb
|
43
|
+
- app/models/auditor.rb
|
44
|
+
- app/models/auditor/approval.rb
|
45
|
+
- app/models/auditor/audit.rb
|
46
|
+
- app/models/auditor/ext/audited.rb
|
47
|
+
- app/models/auditor/ext/verifiable.rb
|
48
|
+
- app/models/auditor/ext/verified.rb
|
49
|
+
- app/models/auditor/model/approval.rb
|
50
|
+
- app/models/auditor/model/approving.rb
|
51
|
+
- app/models/auditor/model/audit.rb
|
52
|
+
- app/models/auditor/model/verification.rb
|
53
|
+
- app/models/auditor/model/verifier.rb
|
54
|
+
- app/models/auditor/verification.rb
|
55
|
+
- app/models/auditor/verifier.rb
|
56
|
+
- app/views/auditor/_approvals.html.erb
|
57
|
+
- app/views/auditor/_checks.html.erb
|
58
|
+
- app/views/auditor/admin/approvals/_filter.html.erb
|
59
|
+
- app/views/auditor/admin/approvals/_form.html.erb
|
60
|
+
- app/views/auditor/admin/approvals/_index.html.erb
|
61
|
+
- app/views/auditor/admin/approvals/_show_table.html.erb
|
62
|
+
- app/views/auditor/admin/approvals/_table.html.erb
|
63
|
+
- app/views/auditor/admin/approvals/index.js.erb
|
64
|
+
- app/views/auditor/admin/audits/_button.html.erb
|
65
|
+
- app/views/auditor/admin/audits/_index_tbody.html.erb
|
66
|
+
- app/views/auditor/admin/audits/_index_thead.html.erb
|
67
|
+
- app/views/auditor/admin/audits/index.html.erb
|
68
|
+
- app/views/auditor/admin/verifications/_edit_form.html.erb
|
69
|
+
- app/views/auditor/admin/verifications/_filter_form.html.erb
|
70
|
+
- app/views/auditor/admin/verifications/_index_tbody.html.erb
|
71
|
+
- app/views/auditor/admin/verifications/_index_thead.html.erb
|
72
|
+
- app/views/auditor/admin/verifications/_new_form.html.erb
|
73
|
+
- app/views/auditor/admin/verifications/_show_table.html.erb
|
74
|
+
- app/views/auditor/admin/verifiers/_edit_form.html.erb
|
75
|
+
- app/views/auditor/admin/verifiers/_filter_form.html.erb
|
76
|
+
- app/views/auditor/admin/verifiers/_form.html.erb
|
77
|
+
- app/views/auditor/admin/verifiers/_index_tbody.html.erb
|
78
|
+
- app/views/auditor/admin/verifiers/_index_thead.html.erb
|
79
|
+
- app/views/auditor/admin/verifiers/_member_field.html.erb
|
80
|
+
- app/views/auditor/admin/verifiers/_new_form.html.erb
|
81
|
+
- app/views/auditor/admin/verifiers/_show_table.html.erb
|
82
|
+
- app/views/auditor/admin/verifiers/members.turbo_stream.erb
|
83
|
+
- config/locales/en.yml
|
84
|
+
- config/locales/zh.controller.yml
|
85
|
+
- config/locales/zh.enum.yml
|
86
|
+
- config/locales/zh.yml
|
53
87
|
- config/routes.rb
|
54
|
-
- db/migrate/20170314035239_create_audits.rb
|
55
88
|
- lib/rails_audit.rb
|
56
|
-
- lib/rails_audit/
|
89
|
+
- lib/rails_audit/config.rb
|
57
90
|
- lib/rails_audit/engine.rb
|
58
|
-
-
|
59
|
-
-
|
91
|
+
- test/controllers/audit/admin/approvals_controller_test.rb
|
92
|
+
- test/dummy/Gemfile
|
93
|
+
- test/dummy/Gemfile.lock
|
60
94
|
- test/dummy/README.md
|
61
95
|
- test/dummy/Rakefile
|
62
|
-
- test/dummy/app/assets/
|
96
|
+
- test/dummy/app/assets/images/default_avatar.jpg
|
97
|
+
- test/dummy/app/assets/images/logo.png
|
98
|
+
- test/dummy/app/assets/javascripts/admin/application.js
|
63
99
|
- test/dummy/app/assets/javascripts/application.js
|
64
|
-
- test/dummy/app/assets/javascripts/
|
65
|
-
- test/dummy/app/assets/stylesheets/
|
100
|
+
- test/dummy/app/assets/javascripts/phone.js
|
101
|
+
- test/dummy/app/assets/stylesheets/css.scss
|
66
102
|
- test/dummy/app/channels/application_cable/channel.rb
|
67
103
|
- test/dummy/app/channels/application_cable/connection.rb
|
68
|
-
- test/dummy/app/controllers/
|
104
|
+
- test/dummy/app/controllers/active_storage/base_controller.rb
|
105
|
+
- test/dummy/app/controllers/admin_controller.rb
|
69
106
|
- test/dummy/app/controllers/application_controller.rb
|
70
107
|
- test/dummy/app/controllers/home_controller.rb
|
71
|
-
- test/dummy/app/controllers/
|
108
|
+
- test/dummy/app/controllers/me_controller.rb
|
109
|
+
- test/dummy/app/controllers/my_controller.rb
|
72
110
|
- test/dummy/app/helpers/application_helper.rb
|
73
111
|
- test/dummy/app/jobs/application_job.rb
|
74
112
|
- test/dummy/app/mailers/application_mailer.rb
|
75
|
-
- test/dummy/app/models/
|
76
|
-
- test/dummy/app/
|
77
|
-
- test/dummy/app/views/
|
113
|
+
- test/dummy/app/models/auth/user.rb
|
114
|
+
- test/dummy/app/views/home/index.css
|
115
|
+
- test/dummy/app/views/home/index.html.erb
|
78
116
|
- test/dummy/app/views/layouts/_right_menu.html.erb
|
79
|
-
- test/dummy/app/views/layouts/application.html.erb
|
80
|
-
- test/dummy/app/views/layouts/mailer.html.erb
|
81
|
-
- test/dummy/app/views/layouts/mailer.text.erb
|
82
117
|
- test/dummy/bin/bundle
|
83
118
|
- test/dummy/bin/rails
|
84
119
|
- test/dummy/bin/rake
|
85
120
|
- test/dummy/bin/setup
|
86
|
-
- test/dummy/bin/
|
121
|
+
- test/dummy/bin/vite
|
122
|
+
- test/dummy/bin/yarn
|
87
123
|
- test/dummy/config.ru
|
88
124
|
- test/dummy/config/application.rb
|
89
125
|
- test/dummy/config/boot.rb
|
90
126
|
- test/dummy/config/cable.yml
|
91
|
-
- test/dummy/config/
|
92
|
-
- test/dummy/config/
|
127
|
+
- test/dummy/config/credentials.yml.enc
|
128
|
+
- test/dummy/config/credentials/development.key
|
129
|
+
- test/dummy/config/credentials/test.key
|
130
|
+
- test/dummy/config/database.yml
|
93
131
|
- test/dummy/config/environment.rb
|
94
132
|
- test/dummy/config/environments/development.rb
|
95
133
|
- test/dummy/config/environments/production.rb
|
96
134
|
- test/dummy/config/environments/test.rb
|
97
135
|
- test/dummy/config/initializers/application_controller_renderer.rb
|
98
|
-
- test/dummy/config/initializers/assets.rb
|
99
136
|
- test/dummy/config/initializers/backtrace_silencers.rb
|
100
137
|
- test/dummy/config/initializers/cookies_serializer.rb
|
101
138
|
- test/dummy/config/initializers/filter_parameter_logging.rb
|
@@ -105,13 +142,17 @@ files:
|
|
105
142
|
- test/dummy/config/initializers/session_store.rb
|
106
143
|
- test/dummy/config/initializers/wrap_parameters.rb
|
107
144
|
- test/dummy/config/locales/en.yml
|
145
|
+
- test/dummy/config/master.key
|
108
146
|
- test/dummy/config/puma.rb
|
109
147
|
- test/dummy/config/routes.rb
|
110
|
-
- test/dummy/config/secrets.yml
|
111
148
|
- test/dummy/config/spring.rb
|
112
|
-
- test/dummy/
|
113
|
-
- test/dummy/
|
149
|
+
- test/dummy/config/storage.yml
|
150
|
+
- test/dummy/config/vite/base.js
|
151
|
+
- test/dummy/config/vite/development.js
|
152
|
+
- test/dummy/config/vite/production.js
|
153
|
+
- test/dummy/lib/deploy.rb
|
114
154
|
- test/dummy/package.json
|
155
|
+
- test/dummy/postcss.config.js
|
115
156
|
- test/dummy/public/404.html
|
116
157
|
- test/dummy/public/422.html
|
117
158
|
- test/dummy/public/500.html
|
@@ -119,12 +160,14 @@ files:
|
|
119
160
|
- test/dummy/public/apple-touch-icon.png
|
120
161
|
- test/dummy/public/favicon.ico
|
121
162
|
- test/dummy/yarn.lock
|
163
|
+
- test/factories/approvals.rb
|
164
|
+
- test/factories/infos.rb
|
122
165
|
- test/integration/navigation_test.rb
|
166
|
+
- test/rails_audit_test.rb
|
123
167
|
- test/test_helper.rb
|
124
|
-
|
125
|
-
homepage: https://github.com/yougexiangfa/rails_audit
|
168
|
+
homepage: https://github.com/work-design/rails_audit
|
126
169
|
licenses:
|
127
|
-
-
|
170
|
+
- MIT
|
128
171
|
metadata: {}
|
129
172
|
post_install_message:
|
130
173
|
rdoc_options: []
|
@@ -141,74 +184,85 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
184
|
- !ruby/object:Gem::Version
|
142
185
|
version: '0'
|
143
186
|
requirements: []
|
144
|
-
|
145
|
-
rubygems_version: 2.7.7
|
187
|
+
rubygems_version: 3.2.22
|
146
188
|
signing_key:
|
147
189
|
specification_version: 4
|
148
|
-
summary:
|
190
|
+
summary: Audit changes for model with operator
|
149
191
|
test_files:
|
150
|
-
- test/
|
151
|
-
- test/dummy/
|
152
|
-
- test/dummy/
|
153
|
-
- test/dummy/
|
192
|
+
- test/controllers/audit/admin/approvals_controller_test.rb
|
193
|
+
- test/dummy/Gemfile
|
194
|
+
- test/dummy/Gemfile.lock
|
195
|
+
- test/dummy/README.md
|
196
|
+
- test/dummy/Rakefile
|
197
|
+
- test/dummy/app/assets/images/default_avatar.jpg
|
198
|
+
- test/dummy/app/assets/images/logo.png
|
199
|
+
- test/dummy/app/assets/javascripts/admin/application.js
|
200
|
+
- test/dummy/app/assets/javascripts/application.js
|
201
|
+
- test/dummy/app/assets/javascripts/phone.js
|
202
|
+
- test/dummy/app/assets/stylesheets/css.scss
|
203
|
+
- test/dummy/app/channels/application_cable/channel.rb
|
204
|
+
- test/dummy/app/channels/application_cable/connection.rb
|
205
|
+
- test/dummy/app/controllers/active_storage/base_controller.rb
|
206
|
+
- test/dummy/app/controllers/admin_controller.rb
|
154
207
|
- test/dummy/app/controllers/application_controller.rb
|
155
|
-
- test/dummy/app/controllers/admin/base_controller.rb
|
156
208
|
- test/dummy/app/controllers/home_controller.rb
|
157
|
-
- test/dummy/app/controllers/
|
158
|
-
- test/dummy/app/
|
159
|
-
- test/dummy/app/views/layouts/application.html.erb
|
160
|
-
- test/dummy/app/views/layouts/mailer.html.erb
|
161
|
-
- test/dummy/app/views/layouts/mailer.text.erb
|
162
|
-
- test/dummy/app/views/layouts/_right_menu.html.erb
|
163
|
-
- test/dummy/app/assets/config/manifest.js
|
164
|
-
- test/dummy/app/assets/javascripts/cable.js
|
165
|
-
- test/dummy/app/assets/javascripts/application.js
|
166
|
-
- test/dummy/app/assets/stylesheets/application.css
|
209
|
+
- test/dummy/app/controllers/me_controller.rb
|
210
|
+
- test/dummy/app/controllers/my_controller.rb
|
167
211
|
- test/dummy/app/helpers/application_helper.rb
|
168
|
-
- test/dummy/app/
|
169
|
-
- test/dummy/app/
|
170
|
-
- test/dummy/
|
171
|
-
- test/dummy/
|
172
|
-
- test/dummy/
|
212
|
+
- test/dummy/app/jobs/application_job.rb
|
213
|
+
- test/dummy/app/mailers/application_mailer.rb
|
214
|
+
- test/dummy/app/models/auth/user.rb
|
215
|
+
- test/dummy/app/views/home/index.css
|
216
|
+
- test/dummy/app/views/home/index.html.erb
|
217
|
+
- test/dummy/app/views/layouts/_right_menu.html.erb
|
173
218
|
- test/dummy/bin/bundle
|
174
219
|
- test/dummy/bin/rails
|
175
|
-
- test/dummy/
|
176
|
-
- test/dummy/
|
177
|
-
- test/dummy/
|
178
|
-
- test/dummy/
|
220
|
+
- test/dummy/bin/rake
|
221
|
+
- test/dummy/bin/setup
|
222
|
+
- test/dummy/bin/vite
|
223
|
+
- test/dummy/bin/yarn
|
224
|
+
- test/dummy/config/application.rb
|
225
|
+
- test/dummy/config/boot.rb
|
179
226
|
- test/dummy/config/cable.yml
|
180
|
-
- test/dummy/config/
|
227
|
+
- test/dummy/config/credentials/development.key
|
228
|
+
- test/dummy/config/credentials/test.key
|
229
|
+
- test/dummy/config/credentials.yml.enc
|
230
|
+
- test/dummy/config/database.yml
|
231
|
+
- test/dummy/config/environment.rb
|
181
232
|
- test/dummy/config/environments/development.rb
|
233
|
+
- test/dummy/config/environments/production.rb
|
182
234
|
- test/dummy/config/environments/test.rb
|
183
|
-
- test/dummy/config/spring.rb
|
184
|
-
- test/dummy/config/environment.rb
|
185
|
-
- test/dummy/config/application.rb
|
186
|
-
- test/dummy/config/puma.rb
|
187
|
-
- test/dummy/config/database.yml.sqlite3
|
188
|
-
- test/dummy/config/boot.rb
|
189
235
|
- test/dummy/config/initializers/application_controller_renderer.rb
|
190
236
|
- test/dummy/config/initializers/backtrace_silencers.rb
|
191
|
-
- test/dummy/config/initializers/
|
237
|
+
- test/dummy/config/initializers/cookies_serializer.rb
|
192
238
|
- test/dummy/config/initializers/filter_parameter_logging.rb
|
239
|
+
- test/dummy/config/initializers/inflections.rb
|
240
|
+
- test/dummy/config/initializers/mime_types.rb
|
241
|
+
- test/dummy/config/initializers/new_framework_defaults.rb
|
193
242
|
- test/dummy/config/initializers/session_store.rb
|
194
243
|
- test/dummy/config/initializers/wrap_parameters.rb
|
195
|
-
- test/dummy/config/
|
196
|
-
- test/dummy/config/
|
197
|
-
- test/dummy/config/
|
198
|
-
- test/dummy/config/
|
244
|
+
- test/dummy/config/locales/en.yml
|
245
|
+
- test/dummy/config/master.key
|
246
|
+
- test/dummy/config/puma.rb
|
247
|
+
- test/dummy/config/routes.rb
|
248
|
+
- test/dummy/config/spring.rb
|
249
|
+
- test/dummy/config/storage.yml
|
250
|
+
- test/dummy/config/vite/base.js
|
251
|
+
- test/dummy/config/vite/development.js
|
252
|
+
- test/dummy/config/vite/production.js
|
199
253
|
- test/dummy/config.ru
|
200
|
-
- test/dummy/
|
201
|
-
- test/dummy/
|
202
|
-
- test/dummy/
|
203
|
-
- test/dummy/public/
|
254
|
+
- test/dummy/lib/deploy.rb
|
255
|
+
- test/dummy/package.json
|
256
|
+
- test/dummy/postcss.config.js
|
257
|
+
- test/dummy/public/404.html
|
204
258
|
- test/dummy/public/422.html
|
205
|
-
- test/dummy/public/apple-touch-icon.png
|
206
259
|
- test/dummy/public/500.html
|
207
|
-
- test/dummy/public/404.html
|
208
260
|
- test/dummy/public/apple-touch-icon-precomposed.png
|
209
|
-
- test/dummy/
|
210
|
-
- test/dummy/
|
211
|
-
- test/dummy/
|
261
|
+
- test/dummy/public/apple-touch-icon.png
|
262
|
+
- test/dummy/public/favicon.ico
|
263
|
+
- test/dummy/yarn.lock
|
264
|
+
- test/factories/approvals.rb
|
265
|
+
- test/factories/infos.rb
|
212
266
|
- test/integration/navigation_test.rb
|
213
|
-
- test/
|
267
|
+
- test/rails_audit_test.rb
|
214
268
|
- test/test_helper.rb
|
@@ -1,12 +0,0 @@
|
|
1
|
-
class Admin::AuditsController < Admin::BaseController
|
2
|
-
|
3
|
-
def index
|
4
|
-
@audits = Audit.where(auditable_type: params[:auditable_type], auditable_id: params[:auditable_id]).page(params[:page])
|
5
|
-
|
6
|
-
respond_to do |format|
|
7
|
-
format.html
|
8
|
-
format.js
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
class Audit < ApplicationRecord
|
2
|
-
serialize :audited_changes, Hash
|
3
|
-
serialize :related_changes, Hash
|
4
|
-
serialize :unconfirmed_changes, Hash
|
5
|
-
serialize :extra, Hash
|
6
|
-
|
7
|
-
belongs_to :auditable, polymorphic: true
|
8
|
-
belongs_to :operator, polymorphic: true
|
9
|
-
|
10
|
-
def audited_changes_i18n
|
11
|
-
audited_changes.transform_keys { |key| auditable.class.human_attribute_name(key) }
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
@@ -1,59 +0,0 @@
|
|
1
|
-
module Auditable
|
2
|
-
extend ActiveSupport::Concern
|
3
|
-
IGNORE = ['updated_at']
|
4
|
-
|
5
|
-
included do
|
6
|
-
has_many :audits, as: :auditable
|
7
|
-
end
|
8
|
-
|
9
|
-
# user: {
|
10
|
-
# id: 1,
|
11
|
-
# changes: {
|
12
|
-
# name: ['a', 'b']
|
13
|
-
# }
|
14
|
-
# }
|
15
|
-
|
16
|
-
def save_audits(operator: current_operator, include: [], **extra_options)
|
17
|
-
audit = self.audits.build
|
18
|
-
audit.audited_changes = self.saved_changes.except(*IGNORE)
|
19
|
-
audit.unconfirmed_changes = self.changes
|
20
|
-
|
21
|
-
if include.present?
|
22
|
-
result = {}
|
23
|
-
|
24
|
-
include.each do |key|
|
25
|
-
targets = self.send(key)
|
26
|
-
result[key] = []
|
27
|
-
|
28
|
-
Array(targets).each do |target|
|
29
|
-
_saved_changes = target.saved_changes.except(*IGNORE)
|
30
|
-
_changes = target.changes
|
31
|
-
|
32
|
-
if _saved_changes.present? || _changes.present?
|
33
|
-
result[key] << {
|
34
|
-
id: target.id,
|
35
|
-
saved_changes: _saved_changes,
|
36
|
-
changes: _changes
|
37
|
-
}
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
audit.related_changes = result
|
43
|
-
end
|
44
|
-
|
45
|
-
if self.destroyed?
|
46
|
-
audit.action = 'destroy'
|
47
|
-
end
|
48
|
-
|
49
|
-
audit.operator_type = operator.class.name
|
50
|
-
audit.operator_id = operator.id
|
51
|
-
audit.note = extra_options.delete(:note)
|
52
|
-
audit.controller_path = extra_options.delete(:controller_path)
|
53
|
-
audit.action_name = extra_options.delete(:action_name)
|
54
|
-
audit.remote_ip = extra_options.delete(:remote_ip)
|
55
|
-
audit.extra = extra_options
|
56
|
-
audit.save
|
57
|
-
end
|
58
|
-
|
59
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
class History < ApplicationRecord
|
2
|
-
paginates_per 10
|
3
|
-
|
4
|
-
belongs_to :wiki
|
5
|
-
belongs_to :knowledge
|
6
|
-
belongs_to :commit, class_name: 'User', foreign_key: 'commit_id'
|
7
|
-
validates :commit_id, presence: true
|
8
|
-
validates :active, uniqueness: { scope: :knowledge_id }
|
9
|
-
|
10
|
-
enum status: [:status_initial, :status_passed]
|
11
|
-
|
12
|
-
default_scope -> { order(id: :desc) }
|
13
|
-
def set_active
|
14
|
-
self.class.where.not(id: self.id).where(knowledge_id: self.knowledge_id).update_all(active: false)
|
15
|
-
self.update(active: true)
|
16
|
-
move_to_wiki
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
|
21
|
-
# :item_id, :integer
|
22
|
-
# :user_id, :integer
|
23
|
-
# :content, :string, limit: 65535
|
24
|
-
# :commit_id, :integer
|
25
|
-
# :commit_message, :string
|
26
|
-
#
|
27
|
-
# t.integer "wiki_id", limit: 4
|
28
|
-
# t.integer "knowledge_id", limit: 4
|
29
|
-
# t.text "body", limit: 65535
|
30
|
-
# t.string "commit_message", limit: 4096
|
31
|
-
# t.datetime "created_at"
|
32
|
-
# t.datetime "updated_at"
|
33
|
-
# t.integer "commit_id", limit: 4
|
34
|
-
# t.boolean "active", default: false
|
35
|
-
# t.integer "status", limit: 4, default: 0
|
36
|
-
# t.string "type", limit: 255
|
@@ -1,14 +0,0 @@
|
|
1
|
-
class MajorRecord < ApplicationRecord
|
2
|
-
|
3
|
-
belongs_to :knowledge, counter_cache: true
|
4
|
-
|
5
|
-
def move_to_wiki
|
6
|
-
wiki = knowledge.major || knowledge.build_major
|
7
|
-
wiki.commit_id = self.commit_id
|
8
|
-
wiki.commit_message = self.commit_message
|
9
|
-
wiki.body = self.body
|
10
|
-
wiki.save
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|
14
|
-
|
@@ -1,15 +0,0 @@
|
|
1
|
-
class MinorRecord < ApplicationRecord
|
2
|
-
|
3
|
-
belongs_to :knowledge, counter_cache: true
|
4
|
-
|
5
|
-
def move_to_wiki
|
6
|
-
wiki = knowledge.minor || knowledge.build_minor
|
7
|
-
wiki.commit_id = self.commit_id
|
8
|
-
wiki.commit_message = self.commit_message
|
9
|
-
wiki.body = self.body
|
10
|
-
wiki.save
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|
14
|
-
|
15
|
-
|
@@ -1,61 +0,0 @@
|
|
1
|
-
<table class="ui table">
|
2
|
-
<thead>
|
3
|
-
<tr>
|
4
|
-
<th>Operator</th>
|
5
|
-
<th>Note</th>
|
6
|
-
<th>Changes</th>
|
7
|
-
<th>Related Changes</th>
|
8
|
-
</tr>
|
9
|
-
</thead>
|
10
|
-
|
11
|
-
<tbody>
|
12
|
-
<% @audits.each do |audit| %>
|
13
|
-
<tr id="audit_<%= audit.id %>">
|
14
|
-
<td>
|
15
|
-
<p><%= audit.operator&.name %></p>
|
16
|
-
<p><%= audit.action %></p>
|
17
|
-
<p><time><%= audit.created_at.to_s(:rfc822) %></time></p>
|
18
|
-
<div class="ui labels">
|
19
|
-
<span class="ui label">Action: <%= audit.action %></span>
|
20
|
-
<span class="ui label">Path: <%= audit.controller_path %>/<%= audit.action_name %></span>
|
21
|
-
</div>
|
22
|
-
<p>IP: <%= audit.remote_ip %></p>
|
23
|
-
</td>
|
24
|
-
<td><%= audit.note %></td>
|
25
|
-
<td class="ui list">
|
26
|
-
<% audit.audited_changes_i18n.each do |key, value| %>
|
27
|
-
<div class="item">
|
28
|
-
<div class="ui label">
|
29
|
-
<%= key %>:
|
30
|
-
<div class="detail">
|
31
|
-
<span><%= value[0] %></span>
|
32
|
-
<i class="arrow circle right icon grey"></i>
|
33
|
-
<span><%= value[1] %></span>
|
34
|
-
</div>
|
35
|
-
</div>
|
36
|
-
</div>
|
37
|
-
<% end %>
|
38
|
-
</td>
|
39
|
-
<td>
|
40
|
-
<% audit.related_changes.each do |key, value| %>
|
41
|
-
<% value.each do |relate| %>
|
42
|
-
<div class="ui segment">
|
43
|
-
<span class="ui blue label"><%= key %>: <%= relate[:id] %></span>
|
44
|
-
<div class="ui divider"></div>
|
45
|
-
<% relate[:changes].each do |k, v| %>
|
46
|
-
<div class="ui label"><%= k %>: </div>
|
47
|
-
<%= v[0] %>
|
48
|
-
<i class="arrow circle right icon grey"></i>
|
49
|
-
<%= v[1] %>
|
50
|
-
<% end %>
|
51
|
-
</div>
|
52
|
-
<% end %>
|
53
|
-
<% end %>
|
54
|
-
</td>
|
55
|
-
</tr>
|
56
|
-
<% end %>
|
57
|
-
</tbody>
|
58
|
-
</table>
|
59
|
-
|
60
|
-
|
61
|
-
|