loggable_activity 0.5.4 → 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +10 -0
- data/CHANGELOG.md +12 -3
- data/GETTING-STARTED.md +61 -0
- data/README.md +4 -7
- data/app/views/loggable_activity/activities/_activities.html.slim +6 -6
- data/docker-compose.yml +27 -0
- data/docs/CHANGELOG_md.html +318 -0
- data/docs/CHEAT_SHEET_md.html +168 -0
- data/docs/CODE_OF_CONDUCT_md.html +250 -0
- data/docs/CreateLoggableActivities.html +175 -0
- data/docs/CreateLoggableActivityTables.html +173 -0
- data/docs/GETTING-STARTED_md.html +211 -0
- data/docs/Gemfile.html +153 -0
- data/docs/Gemfile_lock.html +438 -0
- data/docs/LoggableActivity/ActivitiesController.html +160 -0
- data/docs/LoggableActivity/ActivitiesHelper.html +158 -0
- data/docs/LoggableActivity/Activity.html +565 -0
- data/docs/LoggableActivity/ApplicationController.html +97 -0
- data/docs/LoggableActivity/ApplicationHelper.html +91 -0
- data/docs/LoggableActivity/ApplicationJob.html +97 -0
- data/docs/LoggableActivity/ApplicationMailer.html +97 -0
- data/docs/LoggableActivity/ApplicationRecord.html +97 -0
- data/docs/LoggableActivity/Configuration.html +237 -0
- data/docs/LoggableActivity/ConfigurationError.html +142 -0
- data/docs/LoggableActivity/CurrentActor.html +166 -0
- data/docs/LoggableActivity/DataOwner.html +138 -0
- data/docs/LoggableActivity/Encryption.html +321 -0
- data/docs/LoggableActivity/EncryptionError.html +142 -0
- data/docs/LoggableActivity/EncryptionKey.html +399 -0
- data/docs/LoggableActivity/Engine.html +108 -0
- data/docs/LoggableActivity/Error.html +142 -0
- data/docs/LoggableActivity/Generators/InstallGenerator.html +212 -0
- data/docs/LoggableActivity/Generators.html +91 -0
- data/docs/LoggableActivity/Hooks.html +841 -0
- data/docs/LoggableActivity/Payload.html +430 -0
- data/docs/LoggableActivity/Sanitizer.html +134 -0
- data/docs/LoggableActivity/Services/BasePayloadsBuilder.html +472 -0
- data/docs/LoggableActivity/Services/CustomPayloadsBuilder.html +225 -0
- data/docs/LoggableActivity/Services/DestroyPayloadsBuilder.html +396 -0
- data/docs/LoggableActivity/Services/PayloadsBuilder.html +348 -0
- data/docs/LoggableActivity/Services/UpdatePayloadsBuilder.html +540 -0
- data/docs/LoggableActivity/Services.html +93 -0
- data/docs/LoggableActivity.html +173 -0
- data/docs/MIT-LICENSE.html +132 -0
- data/docs/Object.html +110 -0
- data/docs/README_md.html +186 -0
- data/docs/Rakefile.html +134 -0
- data/docs/app/assets/config/loggable_activity_manifest_js.html +126 -0
- data/docs/app/assets/javascripts/loggable_activity/application_js.html +124 -0
- data/docs/app/assets/stylesheets/loggable_activity/activities_scss.html +154 -0
- data/docs/app/assets/stylesheets/loggable_activity/application_scss.html +142 -0
- data/docs/app/views/layouts/loggable_activity/application_html_slim.html +145 -0
- data/docs/app/views/loggable_activity/activities/_activities_html_slim.html +159 -0
- data/docs/created.rid +74 -0
- data/docs/css/fonts.css +167 -0
- data/docs/css/rdoc.css +687 -0
- data/docs/fonts/Lato-Light.ttf +0 -0
- data/docs/fonts/Lato-LightItalic.ttf +0 -0
- data/docs/fonts/Lato-Regular.ttf +0 -0
- data/docs/fonts/Lato-RegularItalic.ttf +0 -0
- data/docs/fonts/SourceCodePro-Bold.ttf +0 -0
- data/docs/fonts/SourceCodePro-Regular.ttf +0 -0
- data/docs/git-org/HEAD.html +126 -0
- data/docs/git-org/config.html +128 -0
- data/docs/git-org/description.html +126 -0
- data/docs/git-org/hooks/applypatch-msg_sample.html +128 -0
- data/docs/git-org/hooks/commit-msg_sample.html +138 -0
- data/docs/git-org/hooks/fsmonitor-watchman_sample.html +302 -0
- data/docs/git-org/hooks/post-update_sample.html +128 -0
- data/docs/git-org/hooks/pre-applypatch_sample.html +128 -0
- data/docs/git-org/hooks/pre-commit_sample.html +174 -0
- data/docs/git-org/hooks/pre-merge-commit_sample.html +133 -0
- data/docs/git-org/hooks/pre-push_sample.html +161 -0
- data/docs/git-org/hooks/pre-rebase_sample.html +282 -0
- data/docs/git-org/hooks/pre-receive_sample.html +144 -0
- data/docs/git-org/hooks/prepare-commit-msg_sample.html +136 -0
- data/docs/git-org/hooks/push-to-checkout_sample.html +178 -0
- data/docs/git-org/hooks/update_sample.html +226 -0
- data/docs/git-org/info/exclude.html +126 -0
- data/docs/images/add.png +0 -0
- data/docs/images/arrow_up.png +0 -0
- data/docs/images/brick.png +0 -0
- data/docs/images/brick_link.png +0 -0
- data/docs/images/bug.png +0 -0
- data/docs/images/bullet_black.png +0 -0
- data/docs/images/bullet_toggle_minus.png +0 -0
- data/docs/images/bullet_toggle_plus.png +0 -0
- data/docs/images/date.png +0 -0
- data/docs/images/delete.png +0 -0
- data/docs/images/find.png +0 -0
- data/docs/images/loadingAnimation.gif +0 -0
- data/docs/images/macFFBgHack.png +0 -0
- data/docs/images/package.png +0 -0
- data/docs/images/page_green.png +0 -0
- data/docs/images/page_white_text.png +0 -0
- data/docs/images/page_white_width.png +0 -0
- data/docs/images/plugin.png +0 -0
- data/docs/images/ruby.png +0 -0
- data/docs/images/tag_blue.png +0 -0
- data/docs/images/tag_green.png +0 -0
- data/docs/images/transparent.png +0 -0
- data/docs/images/wrench.png +0 -0
- data/docs/images/wrench_orange.png +0 -0
- data/docs/images/zoom.png +0 -0
- data/docs/index.html +166 -0
- data/docs/js/darkfish.js +97 -0
- data/docs/js/navigation.js +105 -0
- data/docs/js/navigation.js.gz +0 -0
- data/docs/js/search.js +110 -0
- data/docs/js/search_index.js +1 -0
- data/docs/js/search_index.js.gz +0 -0
- data/docs/js/searcher.js +229 -0
- data/docs/js/searcher.js.gz +0 -0
- data/docs/lib/loggable_activity/config_schema_json.html +205 -0
- data/docs/lib/tasks/loggable_activity_tasks_rake.html +128 -0
- data/docs/table_of_contents.html +954 -0
- data/lib/generators/loggable_activity/install/install_generator.rb +68 -0
- data/lib/generators/loggable_activity/install/templates/create_loggable_activities.rb +45 -0
- data/lib/generators/loggable_activity/install/templates/loggable_activity.en.yml +32 -0
- data/lib/generators/loggable_activity/install/templates/loggable_activity.rb +27 -0
- data/lib/generators/loggable_activity/install/templates/loggable_activity.yml +103 -0
- data/lib/loggable_activity/activity.rb +4 -4
- data/lib/loggable_activity/concerns/current_actor.rb +25 -0
- data/lib/loggable_activity/config_schema.json +2 -13
- data/lib/loggable_activity/configuration.rb +0 -10
- data/lib/loggable_activity/encryption.rb +33 -12
- data/lib/loggable_activity/encryption_key.rb +1 -1
- data/lib/loggable_activity/error.rb +3 -3
- data/lib/loggable_activity/hooks.rb +74 -18
- data/lib/loggable_activity/payload.rb +6 -4
- data/lib/loggable_activity/services/base_payloads_builder.rb +2 -1
- data/lib/loggable_activity/services/custom_payloads_builder.rb +55 -0
- data/lib/loggable_activity/version.rb +1 -1
- data/lib/loggable_activity.rb +5 -2
- metadata +121 -111
- data/lib/loggable_activity/concerns/current_user.rb +0 -26
@@ -0,0 +1,173 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class CreateLoggableActivityTables - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "./";
|
11
|
+
var index_rel_prefix = "./";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="./js/navigation.js" defer></script>
|
15
|
+
<script src="./js/search.js" defer></script>
|
16
|
+
<script src="./js/search_index.js" defer></script>
|
17
|
+
<script src="./js/searcher.js" defer></script>
|
18
|
+
<script src="./js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="class">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="./index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
62
|
+
<h3>Parent</h3>
|
63
|
+
|
64
|
+
<p class="link">ActiveRecord::Migration[7.1]
|
65
|
+
</div>
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
<!-- Method Quickref -->
|
71
|
+
<div id="method-list-section" class="nav-section">
|
72
|
+
<h3>Methods</h3>
|
73
|
+
|
74
|
+
<ul class="link-list" role="directory">
|
75
|
+
<li ><a href="#method-i-change">#change</a>
|
76
|
+
</ul>
|
77
|
+
</div>
|
78
|
+
|
79
|
+
</div>
|
80
|
+
</nav>
|
81
|
+
|
82
|
+
<main role="main" aria-labelledby="class-CreateLoggableActivityTables">
|
83
|
+
<h1 id="class-CreateLoggableActivityTables" class="class">
|
84
|
+
class CreateLoggableActivityTables
|
85
|
+
</h1>
|
86
|
+
|
87
|
+
<section class="description">
|
88
|
+
|
89
|
+
</section>
|
90
|
+
|
91
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
98
|
+
<header>
|
99
|
+
<h3>Public Instance Methods</h3>
|
100
|
+
</header>
|
101
|
+
|
102
|
+
<div id="method-i-change" class="method-detail ">
|
103
|
+
<div class="method-header">
|
104
|
+
<div class="method-heading">
|
105
|
+
<span class="method-name">change</span><span
|
106
|
+
class="method-args">()</span>
|
107
|
+
<span class="method-click-advice">click to toggle source</span>
|
108
|
+
</div>
|
109
|
+
</div>
|
110
|
+
|
111
|
+
<div class="method-description">
|
112
|
+
|
113
|
+
|
114
|
+
<div class="method-source-code" id="change-source">
|
115
|
+
<pre><span class="ruby-comment"># File db/migrate/20240702092648_create_loggable_activity_tables.rb, line 4</span>
|
116
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">change</span>
|
117
|
+
<span class="ruby-identifier">create_table</span> <span class="ruby-value">:loggable_activity_encryption_keys</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span>
|
118
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">references</span> <span class="ruby-value">:record</span>, <span class="ruby-value">polymorphic:</span> <span class="ruby-keyword">true</span>, <span class="ruby-value">null:</span> <span class="ruby-keyword">true</span>, <span class="ruby-value">index:</span> <span class="ruby-keyword">true</span>
|
119
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">string</span> <span class="ruby-value">:secret_key</span>
|
120
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">datetime</span> <span class="ruby-value">:delete_at</span>
|
121
|
+
|
122
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">timestamps</span>
|
123
|
+
<span class="ruby-keyword">end</span>
|
124
|
+
|
125
|
+
<span class="ruby-identifier">create_table</span> <span class="ruby-value">:loggable_activity_activities</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span>
|
126
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">string</span> <span class="ruby-value">:action</span>
|
127
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">references</span> <span class="ruby-value">:actor</span>, <span class="ruby-value">polymorphic:</span> <span class="ruby-keyword">true</span>, <span class="ruby-value">null:</span> <span class="ruby-keyword">true</span>
|
128
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">string</span> <span class="ruby-value">:encrypted_actor_name</span>
|
129
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">references</span> <span class="ruby-value">:record</span>, <span class="ruby-value">polymorphic:</span> <span class="ruby-keyword">true</span>, <span class="ruby-value">null:</span> <span class="ruby-keyword">true</span>
|
130
|
+
|
131
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">timestamps</span>
|
132
|
+
<span class="ruby-keyword">end</span>
|
133
|
+
|
134
|
+
<span class="ruby-identifier">create_table</span> <span class="ruby-value">:loggable_activity_payloads</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span>
|
135
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">references</span> <span class="ruby-value">:activity</span>, <span class="ruby-value">null:</span> <span class="ruby-keyword">false</span>, <span class="ruby-value">foreign_key:</span> { <span class="ruby-value">to_table:</span> <span class="ruby-string">'loggable_activity_activities'</span> }
|
136
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">references</span> <span class="ruby-value">:encryption_key</span>, <span class="ruby-value">null:</span> <span class="ruby-keyword">false</span>, <span class="ruby-value">foreign_key:</span> { <span class="ruby-value">to_table:</span> <span class="ruby-string">'loggable_activity_encryption_keys'</span> }
|
137
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">references</span> <span class="ruby-value">:record</span>, <span class="ruby-value">polymorphic:</span> <span class="ruby-keyword">true</span>, <span class="ruby-value">null:</span> <span class="ruby-keyword">true</span>, <span class="ruby-value">index:</span> <span class="ruby-keyword">true</span>
|
138
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">string</span> <span class="ruby-value">:encrypted_record_name</span>
|
139
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">json</span> <span class="ruby-value">:encrypted_attrs</span>
|
140
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">integer</span> <span class="ruby-value">:related_to_activity_as</span>, <span class="ruby-value">default:</span> <span class="ruby-value">0</span>
|
141
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">boolean</span> <span class="ruby-value">:data_owner</span>, <span class="ruby-value">default:</span> <span class="ruby-keyword">false</span>
|
142
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">string</span> <span class="ruby-value">:route</span>
|
143
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">boolean</span> <span class="ruby-value">:current_payload</span>, <span class="ruby-value">default:</span> <span class="ruby-keyword">true</span>
|
144
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">json</span> <span class="ruby-value">:public_attrs</span>, <span class="ruby-value">default:</span> {}
|
145
|
+
|
146
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">timestamps</span>
|
147
|
+
<span class="ruby-keyword">end</span>
|
148
|
+
|
149
|
+
<span class="ruby-identifier">create_table</span> <span class="ruby-value">:loggable_activity_data_owners</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span>
|
150
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">references</span> <span class="ruby-value">:record</span>, <span class="ruby-value">polymorphic:</span> <span class="ruby-keyword">true</span>, <span class="ruby-value">null:</span> <span class="ruby-keyword">true</span>, <span class="ruby-value">index:</span> <span class="ruby-keyword">true</span>
|
151
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">references</span> <span class="ruby-value">:encryption_key</span>, <span class="ruby-value">null:</span> <span class="ruby-keyword">false</span>, <span class="ruby-value">foreign_key:</span> { <span class="ruby-value">to_table:</span> <span class="ruby-string">'loggable_activity_encryption_keys'</span> }
|
152
|
+
|
153
|
+
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">timestamps</span>
|
154
|
+
<span class="ruby-keyword">end</span>
|
155
|
+
<span class="ruby-keyword">end</span></pre>
|
156
|
+
</div>
|
157
|
+
</div>
|
158
|
+
|
159
|
+
|
160
|
+
</div>
|
161
|
+
|
162
|
+
</section>
|
163
|
+
|
164
|
+
</section>
|
165
|
+
</main>
|
166
|
+
|
167
|
+
|
168
|
+
<footer id="validator-badges" role="contentinfo">
|
169
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
170
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
171
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
172
|
+
</footer>
|
173
|
+
|
@@ -0,0 +1,211 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>GETTING-STARTED - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "./";
|
11
|
+
var index_rel_prefix = "./";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="./js/navigation.js" defer></script>
|
15
|
+
<script src="./js/search.js" defer></script>
|
16
|
+
<script src="./js/search_index.js" defer></script>
|
17
|
+
<script src="./js/searcher.js" defer></script>
|
18
|
+
<script src="./js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="file">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="./index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
<div class="nav-section">
|
58
|
+
<h3>Table of Contents</h3>
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
<ul class="link-list" role="directory">
|
63
|
+
<li>
|
64
|
+
<details open>
|
65
|
+
<summary> <a href="#label-Getting+started">Getting started</a>
|
66
|
+
</summary>
|
67
|
+
<ul class="link-list" role="directory">
|
68
|
+
<li> <a href="#label-Prerequisite">Prerequisite</a>
|
69
|
+
<li> <a href="#label-Installation">Installation</a>
|
70
|
+
<li> <a href="#label-Add+hoks+to+models">Add hoks to models</a>
|
71
|
+
<li> <a href="#label-Configuration">Configuration</a>
|
72
|
+
<li> <a href="#label-loggable_activity.yaml">loggable_activity.yaml</a>
|
73
|
+
<li> <a href="#label-Automatically+log+show+from+controllers">Automatically log show from controllers</a>
|
74
|
+
<li> <a href="#label-Manually+log+show+from+controllers">Manually log show from controllers</a>
|
75
|
+
<li> <a href="#label-For+developers+and+contributors">For developers and contributors</a>
|
76
|
+
|
77
|
+
</ul>
|
78
|
+
</details>
|
79
|
+
</li>
|
80
|
+
|
81
|
+
</ul>
|
82
|
+
</div>
|
83
|
+
|
84
|
+
|
85
|
+
<div id="project-metadata">
|
86
|
+
|
87
|
+
<div id="fileindex-section" class="nav-section">
|
88
|
+
<h3>Pages</h3>
|
89
|
+
|
90
|
+
<ul class="link-list">
|
91
|
+
<li><a href="./CHANGELOG_md.html">CHANGELOG</a>
|
92
|
+
<li><a href="./CHEAT_SHEET_md.html">CHEAT_SHEET</a>
|
93
|
+
<li><a href="./CODE_OF_CONDUCT_md.html">CODE_OF_CONDUCT</a>
|
94
|
+
<li><a href="./GETTING-STARTED_md.html">GETTING-STARTED</a>
|
95
|
+
<li><a href="./Gemfile.html">Gemfile</a>
|
96
|
+
<li><a href="./Gemfile_lock.html">Gemfile.lock</a>
|
97
|
+
<li><a href="./MIT-LICENSE.html">MIT-LICENSE</a>
|
98
|
+
<li><a href="./README_md.html">README</a>
|
99
|
+
<li><a href="./Rakefile.html">Rakefile</a>
|
100
|
+
<li><details><summary>app</summary>
|
101
|
+
<ul class="link-list">
|
102
|
+
<li><a href="./app/assets/config/loggable_activity_manifest_js.html">loggable_activity_manifest.js</a>
|
103
|
+
<li><a href="./app/assets/javascripts/loggable_activity/application_js.html">application.js</a>
|
104
|
+
<li><a href="./app/assets/stylesheets/loggable_activity/activities_scss.html">activities.scss</a>
|
105
|
+
<li><a href="./app/assets/stylesheets/loggable_activity/application_scss.html">application.scss</a>
|
106
|
+
<li><a href="./app/views/layouts/loggable_activity/application_html_slim.html">application.html.slim</a>
|
107
|
+
<li><a href="./app/views/loggable_activity/activities/_activities_html_slim.html">_activities.html.slim</a>
|
108
|
+
</ul></details>
|
109
|
+
<li><details><summary>git-org</summary>
|
110
|
+
<ul class="link-list">
|
111
|
+
<li><a href="./git-org/HEAD.html">HEAD</a>
|
112
|
+
<li><a href="./git-org/config.html">config</a>
|
113
|
+
<li><a href="./git-org/description.html">description</a>
|
114
|
+
<li><a href="./git-org/hooks/applypatch-msg_sample.html">applypatch-msg.sample</a>
|
115
|
+
<li><a href="./git-org/hooks/commit-msg_sample.html">commit-msg.sample</a>
|
116
|
+
<li><a href="./git-org/hooks/fsmonitor-watchman_sample.html">fsmonitor-watchman.sample</a>
|
117
|
+
<li><a href="./git-org/hooks/post-update_sample.html">post-update.sample</a>
|
118
|
+
<li><a href="./git-org/hooks/pre-applypatch_sample.html">pre-applypatch.sample</a>
|
119
|
+
<li><a href="./git-org/hooks/pre-commit_sample.html">pre-commit.sample</a>
|
120
|
+
<li><a href="./git-org/hooks/pre-merge-commit_sample.html">pre-merge-commit.sample</a>
|
121
|
+
<li><a href="./git-org/hooks/pre-push_sample.html">pre-push.sample</a>
|
122
|
+
<li><a href="./git-org/hooks/pre-rebase_sample.html">pre-rebase.sample</a>
|
123
|
+
<li><a href="./git-org/hooks/pre-receive_sample.html">pre-receive.sample</a>
|
124
|
+
<li><a href="./git-org/hooks/prepare-commit-msg_sample.html">prepare-commit-msg.sample</a>
|
125
|
+
<li><a href="./git-org/hooks/push-to-checkout_sample.html">push-to-checkout.sample</a>
|
126
|
+
<li><a href="./git-org/hooks/update_sample.html">update.sample</a>
|
127
|
+
<li><a href="./git-org/info/exclude.html">exclude</a>
|
128
|
+
</ul></details>
|
129
|
+
<li><details><summary>lib</summary>
|
130
|
+
<ul class="link-list">
|
131
|
+
<li><a href="./lib/loggable_activity/config_schema_json.html">config_schema.json</a>
|
132
|
+
<li><a href="./lib/tasks/loggable_activity_tasks_rake.html">loggable_activity_tasks.rake</a>
|
133
|
+
</ul></details>
|
134
|
+
</ul>
|
135
|
+
</div>
|
136
|
+
|
137
|
+
</div>
|
138
|
+
</nav>
|
139
|
+
|
140
|
+
<main role="main" aria-label="Page GETTING-STARTED.md">
|
141
|
+
|
142
|
+
<h1 id="label-Getting+started">Getting started<span><a href="#label-Getting+started">¶</a> <a href="#top">↑</a></span></h1>
|
143
|
+
|
144
|
+
<p>This document should you getting started with <code>LoggableActivity</code></p>
|
145
|
+
|
146
|
+
<h2 id="label-Prerequisite">Prerequisite<span><a href="#label-Prerequisite">¶</a> <a href="#top">↑</a></span></h2>
|
147
|
+
|
148
|
+
<p>1 A running Rails Application<br/> 2 An authorization system where a current user or similar is available.</p>
|
149
|
+
|
150
|
+
<h2 id="label-Installation">Installation<span><a href="#label-Installation">¶</a> <a href="#top">↑</a></span></h2>
|
151
|
+
|
152
|
+
<p>Add the loggable_activity gem to the <a href="Gemfile.html">Gemfile</a> <code>gem 'loggable_activity', '~> 0.5.4</code> and then<br/></p>
|
153
|
+
|
154
|
+
<pre>$ bundle install</pre>
|
155
|
+
|
156
|
+
<p>Then we have to generate some migrations and execute them<br/></p>
|
157
|
+
|
158
|
+
<pre>$ bin/rails generate loggable_activity:install
|
159
|
+
$ bin/rails db:migrate</pre>
|
160
|
+
|
161
|
+
<h2 id="label-Add+hoks+to+models">Add hoks to models<span><a href="#label-Add+hoks+to+models">¶</a> <a href="#top">↑</a></span></h2>
|
162
|
+
|
163
|
+
<pre>class User < ApplicationRecord
|
164
|
+
include LoggableActivity::Hooks</pre>
|
165
|
+
|
166
|
+
<h2 id="label-Configuration">Configuration<span><a href="#label-Configuration">¶</a> <a href="#top">↑</a></span></h2>
|
167
|
+
|
168
|
+
<p>Update <code>config/initializers/loggable_activity.rb</code> documentation is in the file.</p>
|
169
|
+
|
170
|
+
<h2 id="label-loggable_activity.yaml">loggable_activity.yaml<span><a href="#label-loggable_activity.yaml">¶</a> <a href="#top">↑</a></span></h2>
|
171
|
+
|
172
|
+
<p>You have to update the configuration file installed inside the <code>config/loggable_activity.yaml</code> This file defines how data are logged.</p>
|
173
|
+
|
174
|
+
<h2 id="label-Automatically+log+show+from+controllers">Automatically log show from controllers<span><a href="#label-Automatically+log+show+from+controllers">¶</a> <a href="#top">↑</a></span></h2>
|
175
|
+
|
176
|
+
<p>This assumes that there is a current_user. E.g provided by the Devise gem</br> Add a this to the application_controller.rb if you want automatically log show</p>
|
177
|
+
|
178
|
+
<pre>class ApplicationController < ActionController::Base
|
179
|
+
include LoggableActivity::CurrentUser</pre>
|
180
|
+
|
181
|
+
<p>Otherwise you might create <code>app/controllers/concerns/current_user.rb</code> and alter it .</p>
|
182
|
+
|
183
|
+
<h2 id="label-Manually+log+show+from+controllers">Manually log show from controllers<span><a href="#label-Manually+log+show+from+controllers">¶</a> <a href="#top">↑</a></span></h2>
|
184
|
+
|
185
|
+
<p>If you want to log the show action you can add this to your controllers show method</p>
|
186
|
+
|
187
|
+
<pre>def show
|
188
|
+
@user.log(:show)</pre>
|
189
|
+
|
190
|
+
<h2 id="label-For+developers+and+contributors">For developers and contributors<span><a href="#label-For+developers+and+contributors">¶</a> <a href="#top">↑</a></span></h2>
|
191
|
+
|
192
|
+
<p>You can download and play around with a demo app - 1 Download the project from <a href="https://github.com/LoggableActivity/LoggableActivity">github</a> - 1 Download the demo application from <a href="https://github.com/LoggableActivity/LoggableActivityDemoApp">github</a> - 2 Update the <a href="Gemfile.html">Gemfile</a> in the demo project so it points to your localhost.</p>
|
193
|
+
|
194
|
+
<pre class="ruby"><span class="ruby-constant">Gemfile</span>
|
195
|
+
|
196
|
+
<span class="ruby-identifier">gem</span> <span class="ruby-string">'loggable_activity'</span>, <span class="ruby-string">'~> VERSION'</span>, <span class="ruby-value">path:</span> <span class="ruby-string">'/PATH_TO_PROJECT/LoggableActivityEngine/LoggableActivityEngine'</span>
|
197
|
+
<span class="ruby-comment"># gem 'loggable_activity', '~> VERSION'</span>
|
198
|
+
</pre>
|
199
|
+
|
200
|
+
<p><em>VERSION is the version number found in the gemfile</em><br/> <em>PATH_TO_PROJECT</em> is where you have stored the project on your local drive</p>
|
201
|
+
|
202
|
+
</main>
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
<footer id="validator-badges" role="contentinfo">
|
207
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
208
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
209
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
210
|
+
</footer>
|
211
|
+
|
data/docs/Gemfile.html
ADDED
@@ -0,0 +1,153 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>Gemfile - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "./";
|
11
|
+
var index_rel_prefix = "./";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="./js/navigation.js" defer></script>
|
15
|
+
<script src="./js/search.js" defer></script>
|
16
|
+
<script src="./js/search_index.js" defer></script>
|
17
|
+
<script src="./js/searcher.js" defer></script>
|
18
|
+
<script src="./js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="file">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="./index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="project-metadata">
|
59
|
+
|
60
|
+
<div id="fileindex-section" class="nav-section">
|
61
|
+
<h3>Pages</h3>
|
62
|
+
|
63
|
+
<ul class="link-list">
|
64
|
+
<li><a href="./CHANGELOG_md.html">CHANGELOG</a>
|
65
|
+
<li><a href="./CHEAT_SHEET_md.html">CHEAT_SHEET</a>
|
66
|
+
<li><a href="./CODE_OF_CONDUCT_md.html">CODE_OF_CONDUCT</a>
|
67
|
+
<li><a href="./GETTING-STARTED_md.html">GETTING-STARTED</a>
|
68
|
+
<li><a href="./Gemfile.html">Gemfile</a>
|
69
|
+
<li><a href="./Gemfile_lock.html">Gemfile.lock</a>
|
70
|
+
<li><a href="./MIT-LICENSE.html">MIT-LICENSE</a>
|
71
|
+
<li><a href="./README_md.html">README</a>
|
72
|
+
<li><a href="./Rakefile.html">Rakefile</a>
|
73
|
+
<li><details><summary>app</summary>
|
74
|
+
<ul class="link-list">
|
75
|
+
<li><a href="./app/assets/config/loggable_activity_manifest_js.html">loggable_activity_manifest.js</a>
|
76
|
+
<li><a href="./app/assets/javascripts/loggable_activity/application_js.html">application.js</a>
|
77
|
+
<li><a href="./app/assets/stylesheets/loggable_activity/activities_scss.html">activities.scss</a>
|
78
|
+
<li><a href="./app/assets/stylesheets/loggable_activity/application_scss.html">application.scss</a>
|
79
|
+
<li><a href="./app/views/layouts/loggable_activity/application_html_slim.html">application.html.slim</a>
|
80
|
+
<li><a href="./app/views/loggable_activity/activities/_activities_html_slim.html">_activities.html.slim</a>
|
81
|
+
</ul></details>
|
82
|
+
<li><details><summary>git-org</summary>
|
83
|
+
<ul class="link-list">
|
84
|
+
<li><a href="./git-org/HEAD.html">HEAD</a>
|
85
|
+
<li><a href="./git-org/config.html">config</a>
|
86
|
+
<li><a href="./git-org/description.html">description</a>
|
87
|
+
<li><a href="./git-org/hooks/applypatch-msg_sample.html">applypatch-msg.sample</a>
|
88
|
+
<li><a href="./git-org/hooks/commit-msg_sample.html">commit-msg.sample</a>
|
89
|
+
<li><a href="./git-org/hooks/fsmonitor-watchman_sample.html">fsmonitor-watchman.sample</a>
|
90
|
+
<li><a href="./git-org/hooks/post-update_sample.html">post-update.sample</a>
|
91
|
+
<li><a href="./git-org/hooks/pre-applypatch_sample.html">pre-applypatch.sample</a>
|
92
|
+
<li><a href="./git-org/hooks/pre-commit_sample.html">pre-commit.sample</a>
|
93
|
+
<li><a href="./git-org/hooks/pre-merge-commit_sample.html">pre-merge-commit.sample</a>
|
94
|
+
<li><a href="./git-org/hooks/pre-push_sample.html">pre-push.sample</a>
|
95
|
+
<li><a href="./git-org/hooks/pre-rebase_sample.html">pre-rebase.sample</a>
|
96
|
+
<li><a href="./git-org/hooks/pre-receive_sample.html">pre-receive.sample</a>
|
97
|
+
<li><a href="./git-org/hooks/prepare-commit-msg_sample.html">prepare-commit-msg.sample</a>
|
98
|
+
<li><a href="./git-org/hooks/push-to-checkout_sample.html">push-to-checkout.sample</a>
|
99
|
+
<li><a href="./git-org/hooks/update_sample.html">update.sample</a>
|
100
|
+
<li><a href="./git-org/info/exclude.html">exclude</a>
|
101
|
+
</ul></details>
|
102
|
+
<li><details><summary>lib</summary>
|
103
|
+
<ul class="link-list">
|
104
|
+
<li><a href="./lib/loggable_activity/config_schema_json.html">config_schema.json</a>
|
105
|
+
<li><a href="./lib/tasks/loggable_activity_tasks_rake.html">loggable_activity_tasks.rake</a>
|
106
|
+
</ul></details>
|
107
|
+
</ul>
|
108
|
+
</div>
|
109
|
+
|
110
|
+
</div>
|
111
|
+
</nav>
|
112
|
+
|
113
|
+
<main role="main" aria-label="Page Gemfile">
|
114
|
+
|
115
|
+
<p># frozen_string_literal: true</p>
|
116
|
+
|
117
|
+
<p>source ‘<a href="https://rubygems.org">rubygems.org</a>’ git_source(:github) { |repo| “<a href="https://github.com">github.com</a>/#{repo}.git” }</p>
|
118
|
+
|
119
|
+
<p># Specify your gem’s dependencies in loggable_activity.gemspec. gemspec</p>
|
120
|
+
|
121
|
+
<p>gem ‘puma’</p>
|
122
|
+
|
123
|
+
<p>gem ‘sqlite3’, ‘~> 1.4.2’</p>
|
124
|
+
|
125
|
+
<p>gem ‘sprockets-rails’</p>
|
126
|
+
|
127
|
+
<p>gem ‘sassc-rails’</p>
|
128
|
+
|
129
|
+
<p>gem ‘kaminari’, ‘~> 1.2’, ‘>= 1.2.2’</p>
|
130
|
+
|
131
|
+
<p># Use Slim as template language gem ‘slim-rails’, ‘~> 3.6’, ‘>= 3.6.3’</p>
|
132
|
+
|
133
|
+
<p># Start debugger with binding.b [<a href="https://github.com/ruby/debug">github.com/ruby/debug</a>] # gem “debug”, “>= 1.0.0” group :development, :test do</p>
|
134
|
+
|
135
|
+
<pre class="ruby"><span class="ruby-identifier">gem</span> <span class="ruby-string">'awesome_print'</span>, <span class="ruby-string">'~> 1.9'</span>, <span class="ruby-string">'>= 1.9.2'</span>
|
136
|
+
<span class="ruby-identifier">gem</span> <span class="ruby-string">'factory_bot_rails'</span>, <span class="ruby-string">'~> 6.4'</span>, <span class="ruby-string">'>= 6.4.3'</span>
|
137
|
+
<span class="ruby-identifier">gem</span> <span class="ruby-string">'faker'</span>, <span class="ruby-string">'~> 3.4'</span>, <span class="ruby-string">'>= 3.4.1'</span>
|
138
|
+
<span class="ruby-identifier">gem</span> <span class="ruby-string">'mocha'</span>, <span class="ruby-string">'~> 2.4'</span>
|
139
|
+
<span class="ruby-identifier">gem</span> <span class="ruby-string">'rubocop'</span>, <span class="ruby-string">'~> 1.60'</span>, <span class="ruby-string">'>= 1.60.2'</span>
|
140
|
+
</pre>
|
141
|
+
|
142
|
+
<p>end</p>
|
143
|
+
|
144
|
+
</main>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
<footer id="validator-badges" role="contentinfo">
|
149
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
150
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
151
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
152
|
+
</footer>
|
153
|
+
|