loggable_activity 0.1.39 → 0.1.42
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.document +1 -0
- data/.nojekyll +1 -0
- data/.rubocop.yml +1 -1
- data/doc/.nojekyll +1 -0
- data/doc/CHANGELOG_md.html +125 -0
- data/doc/CODE_OF_CONDUCT_md.html +220 -0
- data/doc/CONSIDERTIONS_md.html +227 -0
- data/doc/CreateLoggableActivities.html +144 -0
- data/doc/CreateLoggableEncryptionKeys.html +140 -0
- data/doc/CreateLoggablePayloads.html +144 -0
- data/doc/GETTING-STARTED_md.html +186 -0
- data/doc/Gemfile.html +104 -0
- data/doc/Gemfile_lock.html +152 -0
- data/doc/LICENSE_txt.html +104 -0
- data/doc/LoggableActivity/CurrentUser.html +99 -0
- data/doc/LoggableActivity/Generators/InstallGenerator.html +178 -0
- data/doc/LoggableActivity/Generators.html +91 -0
- data/doc/README_md.html +138 -0
- data/doc/ROADMAP_md.html +151 -0
- data/doc/Rakefile.html +102 -0
- data/doc/bin/setup.html +100 -0
- data/doc/notes/CHEAT_SHEET_md.html +130 -0
- data/doc/sig/loggable_activity_rbs.html +101 -0
- data/docs/LoggableActivity/Activity.html +494 -0
- data/docs/LoggableActivity/Configuration.html +183 -0
- data/docs/LoggableActivity/Encryption.html +220 -0
- data/docs/LoggableActivity/EncryptionError.html +99 -0
- data/docs/LoggableActivity/EncryptionKey.html +327 -0
- data/docs/LoggableActivity/Error.html +97 -0
- data/docs/LoggableActivity/Hooks.html +172 -0
- data/docs/LoggableActivity/Payload.html +159 -0
- data/docs/LoggableActivity/PayloadsBuilder.html +154 -0
- data/docs/LoggableActivity/UpdatePayloadsBuilder.html +199 -0
- data/docs/LoggableActivity.html +100 -0
- data/docs/created.rid +10 -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/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 +91 -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/table_of_contents.html +184 -0
- data/lib/generators/loggable_activity/install_generator.rb +2 -1
- data/lib/generators/loggable_activity/templates/current_user.rb +1 -1
- data/lib/generators/loggable_activity/templates/loggable_activity.yml +29 -0
- data/lib/loggable_activity/activity.rb +208 -59
- data/lib/loggable_activity/configuration.rb +18 -0
- data/lib/loggable_activity/encryption.rb +20 -1
- data/lib/loggable_activity/encryption_key.rb +81 -14
- data/lib/loggable_activity/hooks.rb +10 -7
- data/lib/loggable_activity/payload.rb +45 -11
- data/lib/loggable_activity/payloads_builder.rb +50 -4
- data/lib/loggable_activity/update_payloads_builder.rb +64 -2
- data/lib/loggable_activity/version.rb +1 -1
- metadata +81 -9
- data/.DS_Store +0 -0
- data/loggable_activity-0.1.32.gem +0 -0
- data/loggable_activity-0.1.33.gem +0 -0
- data/loggable_activity-0.1.34.gem +0 -0
@@ -0,0 +1,327 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class LoggableActivity::EncryptionKey - 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::Base
|
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-c-create_encryption_key">::create_encryption_key</a>
|
76
|
+
<li ><a href="#method-c-for_record">::for_record</a>
|
77
|
+
<li ><a href="#method-c-for_record_by_type_and_id">::for_record_by_type_and_id</a>
|
78
|
+
<li ><a href="#method-c-random_key">::random_key</a>
|
79
|
+
<li ><a href="#method-i-mark_as_deleted">#mark_as_deleted</a>
|
80
|
+
</ul>
|
81
|
+
</div>
|
82
|
+
|
83
|
+
</div>
|
84
|
+
</nav>
|
85
|
+
|
86
|
+
<main role="main" aria-labelledby="class-LoggableActivity::EncryptionKey">
|
87
|
+
<h1 id="class-LoggableActivity::EncryptionKey" class="class">
|
88
|
+
class LoggableActivity::EncryptionKey
|
89
|
+
</h1>
|
90
|
+
|
91
|
+
<section class="description">
|
92
|
+
|
93
|
+
<p>This class represents the encryption key used to unlock the data for one payload. When deleted, only the encryption_key field is deleted.</p>
|
94
|
+
|
95
|
+
</section>
|
96
|
+
|
97
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
104
|
+
<header>
|
105
|
+
<h3>Public Class Methods</h3>
|
106
|
+
</header>
|
107
|
+
|
108
|
+
<div id="method-c-create_encryption_key" class="method-detail ">
|
109
|
+
<div class="method-header">
|
110
|
+
<div class="method-heading">
|
111
|
+
<span class="method-name">create_encryption_key</span><span
|
112
|
+
class="method-args">(record_type, record_id, parent_key = nil)</span>
|
113
|
+
<span class="method-click-advice">click to toggle source</span>
|
114
|
+
</div>
|
115
|
+
</div>
|
116
|
+
|
117
|
+
<div class="method-description">
|
118
|
+
<p>Creates an encryption key for a record, optionally using a parent key.</p>
|
119
|
+
|
120
|
+
<pre>@param record_type [String] The type of the record.
|
121
|
+
@param record_id [Integer] The ID of the record.
|
122
|
+
@param parent_key [LoggableActivity::EncryptionKey, nil] The parent encryption key, if any.
|
123
|
+
@return [LoggableActivity::EncryptionKey] The created encryption key.</pre>
|
124
|
+
|
125
|
+
<p>Example:</p>
|
126
|
+
|
127
|
+
<pre class="ruby"><span class="ruby-constant">LoggableActivity</span><span class="ruby-operator">::</span><span class="ruby-constant">EncryptionKey</span>.<span class="ruby-identifier">create_encryption_key</span>(<span class="ruby-string">'User'</span>, <span class="ruby-value">1</span>)
|
128
|
+
</pre>
|
129
|
+
|
130
|
+
<p>Returns:</p>
|
131
|
+
|
132
|
+
<pre class="ruby">{
|
133
|
+
<span class="ruby-value">:id</span> <span class="ruby-operator">=></span> <span class="ruby-value">39</span>,
|
134
|
+
<span class="ruby-value">:parrent_key_id</span> <span class="ruby-operator">=></span> <span class="ruby-value">38</span>,
|
135
|
+
<span class="ruby-value">:key</span> <span class="ruby-operator">=></span> <span class="ruby-string">"a8f4774e7f42eb253045a4db7de7b79e"</span>,
|
136
|
+
<span class="ruby-value">:record_type</span> <span class="ruby-operator">=></span> <span class="ruby-string">"User"</span>,
|
137
|
+
<span class="ruby-value">:record_id</span> <span class="ruby-operator">=></span> <span class="ruby-value">1</span>
|
138
|
+
}
|
139
|
+
</pre>
|
140
|
+
|
141
|
+
<div class="method-source-code" id="create_encryption_key-source">
|
142
|
+
<pre><span class="ruby-comment"># File lib/loggable_activity/encryption_key.rb, line 92</span>
|
143
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">create_encryption_key</span>(<span class="ruby-identifier">record_type</span>, <span class="ruby-identifier">record_id</span>, <span class="ruby-identifier">parent_key</span> = <span class="ruby-keyword">nil</span>)
|
144
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">parent_key</span>
|
145
|
+
<span class="ruby-identifier">create</span>(<span class="ruby-value">record_type:</span> <span class="ruby-identifier">record_type</span>, <span class="ruby-value">record_id:</span> <span class="ruby-identifier">record_id</span>, <span class="ruby-value">key:</span> <span class="ruby-identifier">random_key</span>, <span class="ruby-value">parent_key_id:</span> <span class="ruby-identifier">parent_key</span>.<span class="ruby-identifier">id</span>)
|
146
|
+
<span class="ruby-keyword">else</span>
|
147
|
+
<span class="ruby-identifier">create</span>(<span class="ruby-value">record_type:</span> <span class="ruby-identifier">record_type</span>, <span class="ruby-value">record_id:</span> <span class="ruby-identifier">record_id</span>, <span class="ruby-value">key:</span> <span class="ruby-identifier">random_key</span>)
|
148
|
+
<span class="ruby-keyword">end</span>
|
149
|
+
<span class="ruby-keyword">end</span></pre>
|
150
|
+
</div>
|
151
|
+
</div>
|
152
|
+
|
153
|
+
|
154
|
+
</div>
|
155
|
+
|
156
|
+
<div id="method-c-for_record" class="method-detail ">
|
157
|
+
<div class="method-header">
|
158
|
+
<div class="method-heading">
|
159
|
+
<span class="method-name">for_record</span><span
|
160
|
+
class="method-args">(record, parent_key = nil)</span>
|
161
|
+
<span class="method-click-advice">click to toggle source</span>
|
162
|
+
</div>
|
163
|
+
</div>
|
164
|
+
|
165
|
+
<div class="method-description">
|
166
|
+
<p>Returns an encryption key for a record, optionally using a parent key.</p>
|
167
|
+
|
168
|
+
<pre>@param record [ActiveRecord::Base] The record for which to get the encryption key.
|
169
|
+
@param parent_key [LoggableActivity::EncryptionKey, nil] The parent encryption key, if any.
|
170
|
+
@return [LoggableActivity::EncryptionKey] The encryption key for the record.</pre>
|
171
|
+
|
172
|
+
<p>Example:</p>
|
173
|
+
|
174
|
+
<pre class="ruby"><span class="ruby-identifier">user</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">find</span>(<span class="ruby-value">1</span>)
|
175
|
+
<span class="ruby-constant">LoggableActivity</span><span class="ruby-operator">::</span><span class="ruby-constant">EncryptionKey</span>.<span class="ruby-identifier">for_record</span>(<span class="ruby-identifier">user</span>)
|
176
|
+
</pre>
|
177
|
+
|
178
|
+
<p>Returns:</p>
|
179
|
+
|
180
|
+
<pre class="ruby">{
|
181
|
+
<span class="ruby-value">:id</span> <span class="ruby-operator">=></span> <span class="ruby-value">39</span>,
|
182
|
+
<span class="ruby-value">:parrent_key_id</span> <span class="ruby-operator">=></span> <span class="ruby-value">38</span>,
|
183
|
+
<span class="ruby-value">:key</span> <span class="ruby-operator">=></span> <span class="ruby-string">"a8f4774e7f42eb253045a4db7de7b79e"</span>,
|
184
|
+
<span class="ruby-value">:record_type</span> <span class="ruby-operator">=></span> <span class="ruby-string">"User"</span>,
|
185
|
+
<span class="ruby-value">:record_id</span> <span class="ruby-operator">=></span> <span class="ruby-value">1</span>
|
186
|
+
}
|
187
|
+
</pre>
|
188
|
+
|
189
|
+
<div class="method-source-code" id="for_record-source">
|
190
|
+
<pre><span class="ruby-comment"># File lib/loggable_activity/encryption_key.rb, line 66</span>
|
191
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">for_record</span>(<span class="ruby-identifier">record</span>, <span class="ruby-identifier">parent_key</span> = <span class="ruby-keyword">nil</span>)
|
192
|
+
<span class="ruby-identifier">encryption_key</span> = <span class="ruby-identifier">find_by</span>(<span class="ruby-value">record:</span> <span class="ruby-identifier">record</span>)
|
193
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">encryption_key</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">encryption_key</span>
|
194
|
+
|
195
|
+
<span class="ruby-identifier">create_encryption_key</span>(<span class="ruby-identifier">record</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">record</span>.<span class="ruby-identifier">id</span>, <span class="ruby-identifier">parent_key</span>)
|
196
|
+
<span class="ruby-keyword">end</span></pre>
|
197
|
+
</div>
|
198
|
+
</div>
|
199
|
+
|
200
|
+
|
201
|
+
</div>
|
202
|
+
|
203
|
+
<div id="method-c-for_record_by_type_and_id" class="method-detail ">
|
204
|
+
<div class="method-header">
|
205
|
+
<div class="method-heading">
|
206
|
+
<span class="method-name">for_record_by_type_and_id</span><span
|
207
|
+
class="method-args">(record_type, record_id, parent_key = nil)</span>
|
208
|
+
<span class="method-click-advice">click to toggle source</span>
|
209
|
+
</div>
|
210
|
+
</div>
|
211
|
+
|
212
|
+
<div class="method-description">
|
213
|
+
<p>Returns an encryption key for a record by its type and ID, optionally using a parent key.</p>
|
214
|
+
|
215
|
+
<pre>@param record_type [String] The type of the record.
|
216
|
+
@param record_id [Integer] The ID of the record.
|
217
|
+
@param parent_key [LoggableActivity::EncryptionKey, nil] The parent encryption key, if any.
|
218
|
+
@return [LoggableActivity::EncryptionKey] The encryption key for the record.</pre>
|
219
|
+
|
220
|
+
<p>Example:</p>
|
221
|
+
|
222
|
+
<pre class="ruby"><span class="ruby-constant">LoggableActivity</span><span class="ruby-operator">::</span><span class="ruby-constant">EncryptionKey</span>.<span class="ruby-identifier">for_record_by_type_and_id</span>(<span class="ruby-string">'User'</span>, <span class="ruby-value">1</span>)
|
223
|
+
</pre>
|
224
|
+
|
225
|
+
<p>Returns:</p>
|
226
|
+
|
227
|
+
<pre class="ruby">{
|
228
|
+
<span class="ruby-value">:id</span> <span class="ruby-operator">=></span> <span class="ruby-value">39</span>,
|
229
|
+
<span class="ruby-value">:parrent_key_id</span> <span class="ruby-operator">=></span> <span class="ruby-value">38</span>,
|
230
|
+
<span class="ruby-value">:key</span> <span class="ruby-operator">=></span> <span class="ruby-string">"a8f4774e7f42eb253045a4db7de7b79e"</span>,
|
231
|
+
<span class="ruby-value">:record_type</span> <span class="ruby-operator">=></span> <span class="ruby-string">"User"</span>,
|
232
|
+
<span class="ruby-value">:record_id</span> <span class="ruby-operator">=></span> <span class="ruby-value">1</span>
|
233
|
+
}
|
234
|
+
</pre>
|
235
|
+
|
236
|
+
<div class="method-source-code" id="for_record_by_type_and_id-source">
|
237
|
+
<pre><span class="ruby-comment"># File lib/loggable_activity/encryption_key.rb, line 40</span>
|
238
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">for_record_by_type_and_id</span>(<span class="ruby-identifier">record_type</span>, <span class="ruby-identifier">record_id</span>, <span class="ruby-identifier">parent_key</span> = <span class="ruby-keyword">nil</span>)
|
239
|
+
<span class="ruby-identifier">encryption_key</span> = <span class="ruby-identifier">find_by</span>(<span class="ruby-value">record_type:</span> <span class="ruby-identifier">record_type</span>, <span class="ruby-value">record_id:</span> <span class="ruby-identifier">record_id</span>)
|
240
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">encryption_key</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">encryption_key</span>
|
241
|
+
|
242
|
+
<span class="ruby-identifier">create_encryption_key</span>(<span class="ruby-identifier">record_type</span>, <span class="ruby-identifier">record_id</span>, <span class="ruby-identifier">parent_key</span>)
|
243
|
+
<span class="ruby-keyword">end</span></pre>
|
244
|
+
</div>
|
245
|
+
</div>
|
246
|
+
|
247
|
+
|
248
|
+
</div>
|
249
|
+
|
250
|
+
<div id="method-c-random_key" class="method-detail ">
|
251
|
+
<div class="method-header">
|
252
|
+
<div class="method-heading">
|
253
|
+
<span class="method-name">random_key</span><span
|
254
|
+
class="method-args">()</span>
|
255
|
+
<span class="method-click-advice">click to toggle source</span>
|
256
|
+
</div>
|
257
|
+
</div>
|
258
|
+
|
259
|
+
<div class="method-description">
|
260
|
+
<p>Generates a random encryption key.</p>
|
261
|
+
|
262
|
+
<pre>@return [String] The generated encryption key.</pre>
|
263
|
+
|
264
|
+
<p>Example:</p>
|
265
|
+
|
266
|
+
<pre class="ruby"><span class="ruby-constant">LoggableActivity</span><span class="ruby-operator">::</span><span class="ruby-constant">EncryptionKey</span>.<span class="ruby-identifier">random_key</span>
|
267
|
+
</pre>
|
268
|
+
|
269
|
+
<p>Returns:</p>
|
270
|
+
|
271
|
+
<pre class="ruby"><span class="ruby-string">"a8f4774e7f42eb253045a4db7de7b79e"</span>
|
272
|
+
</pre>
|
273
|
+
|
274
|
+
<div class="method-source-code" id="random_key-source">
|
275
|
+
<pre><span class="ruby-comment"># File lib/loggable_activity/encryption_key.rb, line 110</span>
|
276
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">random_key</span>
|
277
|
+
<span class="ruby-constant">SecureRandom</span>.<span class="ruby-identifier">hex</span>(<span class="ruby-value">16</span>)
|
278
|
+
<span class="ruby-keyword">end</span></pre>
|
279
|
+
</div>
|
280
|
+
</div>
|
281
|
+
|
282
|
+
|
283
|
+
</div>
|
284
|
+
|
285
|
+
</section>
|
286
|
+
|
287
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
288
|
+
<header>
|
289
|
+
<h3>Public Instance Methods</h3>
|
290
|
+
</header>
|
291
|
+
|
292
|
+
<div id="method-i-mark_as_deleted" class="method-detail ">
|
293
|
+
<div class="method-header">
|
294
|
+
<div class="method-heading">
|
295
|
+
<span class="method-name">mark_as_deleted</span><span
|
296
|
+
class="method-args">()</span>
|
297
|
+
<span class="method-click-advice">click to toggle source</span>
|
298
|
+
</div>
|
299
|
+
</div>
|
300
|
+
|
301
|
+
<div class="method-description">
|
302
|
+
<p>Marks the encryption key as deleted by updating the key to nil.</p>
|
303
|
+
|
304
|
+
<div class="method-source-code" id="mark_as_deleted-source">
|
305
|
+
<pre><span class="ruby-comment"># File lib/loggable_activity/encryption_key.rb, line 16</span>
|
306
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">mark_as_deleted</span>
|
307
|
+
<span class="ruby-identifier">update</span>(<span class="ruby-value">key:</span> <span class="ruby-keyword">nil</span>)
|
308
|
+
<span class="ruby-identifier">parrent_key</span>.<span class="ruby-identifier">mark_as_deleted</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">parrent_key</span>.<span class="ruby-identifier">present?</span>
|
309
|
+
<span class="ruby-keyword">end</span></pre>
|
310
|
+
</div>
|
311
|
+
</div>
|
312
|
+
|
313
|
+
|
314
|
+
</div>
|
315
|
+
|
316
|
+
</section>
|
317
|
+
|
318
|
+
</section>
|
319
|
+
</main>
|
320
|
+
|
321
|
+
|
322
|
+
<footer id="validator-badges" role="contentinfo">
|
323
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
324
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.6.2.
|
325
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
326
|
+
</footer>
|
327
|
+
|
@@ -0,0 +1,97 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class LoggableActivity::Error - 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">StandardError
|
65
|
+
</div>
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</div>
|
71
|
+
</nav>
|
72
|
+
|
73
|
+
<main role="main" aria-labelledby="class-LoggableActivity::Error">
|
74
|
+
<h1 id="class-LoggableActivity::Error" class="class">
|
75
|
+
class LoggableActivity::Error
|
76
|
+
</h1>
|
77
|
+
|
78
|
+
<section class="description">
|
79
|
+
|
80
|
+
</section>
|
81
|
+
|
82
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
</section>
|
89
|
+
</main>
|
90
|
+
|
91
|
+
|
92
|
+
<footer id="validator-badges" role="contentinfo">
|
93
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
94
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.6.2.
|
95
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
96
|
+
</footer>
|
97
|
+
|
@@ -0,0 +1,172 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>module LoggableActivity::Hooks - 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="module">
|
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
|
+
|
62
|
+
<div id="includes-section" class="nav-section">
|
63
|
+
<h3>Included Modules</h3>
|
64
|
+
|
65
|
+
<ul class="link-list">
|
66
|
+
<li><a class="include" href="PayloadsBuilder.html">LoggableActivity::PayloadsBuilder</a>
|
67
|
+
<li><a class="include" href="UpdatePayloadsBuilder.html">LoggableActivity::UpdatePayloadsBuilder</a>
|
68
|
+
</ul>
|
69
|
+
</div>
|
70
|
+
|
71
|
+
|
72
|
+
<div id="extends-section" class="nav-section">
|
73
|
+
<h3>Extended With Modules</h3>
|
74
|
+
|
75
|
+
<ul class="link-list">
|
76
|
+
<li><span class="extend">ActiveSupport::Concern</span>
|
77
|
+
</ul>
|
78
|
+
</div>
|
79
|
+
|
80
|
+
|
81
|
+
<!-- Method Quickref -->
|
82
|
+
<div id="method-list-section" class="nav-section">
|
83
|
+
<h3>Methods</h3>
|
84
|
+
|
85
|
+
<ul class="link-list" role="directory">
|
86
|
+
<li ><a href="#method-i-log">#log</a>
|
87
|
+
</ul>
|
88
|
+
</div>
|
89
|
+
|
90
|
+
</div>
|
91
|
+
</nav>
|
92
|
+
|
93
|
+
<main role="main" aria-labelledby="module-LoggableActivity::Hooks">
|
94
|
+
<h1 id="module-LoggableActivity::Hooks" class="module">
|
95
|
+
module LoggableActivity::Hooks
|
96
|
+
</h1>
|
97
|
+
|
98
|
+
<section class="description">
|
99
|
+
|
100
|
+
<p>This module provides hooks for creating activities when included in a model.</p>
|
101
|
+
|
102
|
+
</section>
|
103
|
+
|
104
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
111
|
+
<header>
|
112
|
+
<h3>Public Instance Methods</h3>
|
113
|
+
</header>
|
114
|
+
|
115
|
+
<div id="method-i-log" class="method-detail ">
|
116
|
+
<div class="method-header">
|
117
|
+
<div class="method-heading">
|
118
|
+
<span class="method-name">log</span><span
|
119
|
+
class="method-args">(action, actor: nil, params: {})</span>
|
120
|
+
<span class="method-click-advice">click to toggle source</span>
|
121
|
+
</div>
|
122
|
+
</div>
|
123
|
+
|
124
|
+
<div class="method-description">
|
125
|
+
<p>Logs an activity with the specified action, actor, and params.</p>
|
126
|
+
|
127
|
+
<pre>@param action [Symbol] The action to log (:create, :update, :destroy, or custom).
|
128
|
+
@param actor [Object] The actor performing the action.
|
129
|
+
@param params [Hash] Additional parameters for the activity.</pre>
|
130
|
+
|
131
|
+
<div class="method-source-code" id="log-source">
|
132
|
+
<pre><span class="ruby-comment"># File lib/loggable_activity/hooks.rb, line 39</span>
|
133
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">log</span>(<span class="ruby-identifier">action</span>, <span class="ruby-value">actor:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">params:</span> {})
|
134
|
+
<span class="ruby-ivar">@action</span> = <span class="ruby-identifier">action</span>
|
135
|
+
<span class="ruby-ivar">@actor</span> = <span class="ruby-identifier">actor</span> <span class="ruby-operator">||</span> <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>[<span class="ruby-value">:current_user</span>]
|
136
|
+
<span class="ruby-comment"># LoggableActivity::EncryptionKey.for_record(self)</span>
|
137
|
+
|
138
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@actor</span>.<span class="ruby-identifier">nil?</span>
|
139
|
+
|
140
|
+
<span class="ruby-ivar">@record</span> = <span class="ruby-keyword">self</span>
|
141
|
+
<span class="ruby-ivar">@params</span> = <span class="ruby-identifier">params</span>
|
142
|
+
<span class="ruby-ivar">@payloads</span> = []
|
143
|
+
|
144
|
+
<span class="ruby-keyword">case</span> <span class="ruby-identifier">action</span>
|
145
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:create</span>, <span class="ruby-value">:show</span>
|
146
|
+
<span class="ruby-identifier">log_activity</span>
|
147
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:destroy</span>
|
148
|
+
<span class="ruby-identifier">log_destroy</span>
|
149
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:update</span>
|
150
|
+
<span class="ruby-identifier">log_update</span>
|
151
|
+
<span class="ruby-keyword">else</span>
|
152
|
+
<span class="ruby-identifier">log_custom_activity</span>(<span class="ruby-identifier">action</span>)
|
153
|
+
<span class="ruby-keyword">end</span>
|
154
|
+
<span class="ruby-keyword">end</span></pre>
|
155
|
+
</div>
|
156
|
+
</div>
|
157
|
+
|
158
|
+
|
159
|
+
</div>
|
160
|
+
|
161
|
+
</section>
|
162
|
+
|
163
|
+
</section>
|
164
|
+
</main>
|
165
|
+
|
166
|
+
|
167
|
+
<footer id="validator-badges" role="contentinfo">
|
168
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
169
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.6.2.
|
170
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
171
|
+
</footer>
|
172
|
+
|