loggable_activity 0.1.45 → 0.1.46
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/docs/LoggableActivity/Activity.html +213 -0
- data/docs/LoggableActivity/Encryption.html +1 -1
- data/docs/LoggableActivity/EncryptionKey.html +13 -13
- data/docs/LoggableActivity/Hooks.html +456 -1
- data/docs/LoggableActivity/Payload.html +172 -1
- data/docs/LoggableActivity/PayloadsBuilder.html +231 -0
- data/docs/LoggableActivity/UpdatePayloadsBuilder.html +226 -1
- data/docs/created.rid +10 -10
- data/docs/js/navigation.js.gz +0 -0
- data/docs/js/search_index.js +1 -1
- data/docs/js/search_index.js.gz +0 -0
- data/docs/js/searcher.js.gz +0 -0
- data/docs/table_of_contents.html +230 -0
- data/lib/generators/loggable_activity/templates/create_loggable_encryption_keys.rb +1 -1
- data/lib/loggable_activity/encryption_key.rb +7 -7
- data/lib/loggable_activity/version.rb +1 -1
- metadata +2 -22
- data/doc/.nojekyll +0 -1
- data/doc/CHANGELOG_md.html +0 -125
- data/doc/CODE_OF_CONDUCT_md.html +0 -220
- data/doc/CONSIDERTIONS_md.html +0 -227
- data/doc/CreateLoggableActivities.html +0 -144
- data/doc/CreateLoggableEncryptionKeys.html +0 -140
- data/doc/CreateLoggablePayloads.html +0 -144
- data/doc/GETTING-STARTED_md.html +0 -186
- data/doc/Gemfile.html +0 -104
- data/doc/Gemfile_lock.html +0 -152
- data/doc/LICENSE_txt.html +0 -104
- data/doc/LoggableActivity/CurrentUser.html +0 -99
- data/doc/LoggableActivity/Generators/InstallGenerator.html +0 -178
- data/doc/LoggableActivity/Generators.html +0 -91
- data/doc/README_md.html +0 -138
- data/doc/ROADMAP_md.html +0 -151
- data/doc/Rakefile.html +0 -102
- data/doc/bin/setup.html +0 -100
- data/doc/notes/CHEAT_SHEET_md.html +0 -130
- data/doc/sig/loggable_activity_rbs.html +0 -101
@@ -1,140 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8">
|
6
|
-
|
7
|
-
<title>class CreateLoggableEncryptionKeys - 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[6.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-CreateLoggableEncryptionKeys">
|
83
|
-
<h1 id="class-CreateLoggableEncryptionKeys" class="class">
|
84
|
-
class CreateLoggableEncryptionKeys
|
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 lib/generators/loggable_activity/templates/create_loggable_encryption_keys.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_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">:parrent_key</span>, <span class="ruby-value">foreign_key:</span> { <span class="ruby-value">to_table:</span> <span class="ruby-string">'loggable_encryption_keys'</span>, <span class="ruby-value">on_delete:</span> <span class="ruby-value">:nullify</span> }
|
119
|
-
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">string</span> <span class="ruby-value">:key</span>
|
120
|
-
<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">on_delete:</span> <span class="ruby-value">:nullify</span>
|
121
|
-
<span class="ruby-keyword">end</span>
|
122
|
-
<span class="ruby-keyword">end</span></pre>
|
123
|
-
</div>
|
124
|
-
</div>
|
125
|
-
|
126
|
-
|
127
|
-
</div>
|
128
|
-
|
129
|
-
</section>
|
130
|
-
|
131
|
-
</section>
|
132
|
-
</main>
|
133
|
-
|
134
|
-
|
135
|
-
<footer id="validator-badges" role="contentinfo">
|
136
|
-
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
137
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.6.2.
|
138
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
139
|
-
</footer>
|
140
|
-
|
@@ -1,144 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8">
|
6
|
-
|
7
|
-
<title>class CreateLoggablePayloads - 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[6.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-CreateLoggablePayloads">
|
83
|
-
<h1 id="class-CreateLoggablePayloads" class="class">
|
84
|
-
class CreateLoggablePayloads
|
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 lib/generators/loggable_activity/templates/create_loggable_payloads.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_payloads</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>
|
119
|
-
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">json</span> <span class="ruby-value">:encrypted_attrs</span>
|
120
|
-
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">integer</span> <span class="ruby-value">:payload_type</span>, <span class="ruby-value">default:</span> <span class="ruby-value">0</span>
|
121
|
-
<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>
|
122
|
-
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">references</span> <span class="ruby-value">:activity</span>, <span class="ruby-value">foreign_key:</span> { <span class="ruby-value">to_table:</span> <span class="ruby-string">'loggable_activities'</span>, <span class="ruby-value">class_name:</span> <span class="ruby-string">'LoggableActivity::Activity'</span> }
|
123
|
-
|
124
|
-
<span class="ruby-identifier">t</span>.<span class="ruby-identifier">timestamps</span>
|
125
|
-
<span class="ruby-keyword">end</span>
|
126
|
-
<span class="ruby-keyword">end</span></pre>
|
127
|
-
</div>
|
128
|
-
</div>
|
129
|
-
|
130
|
-
|
131
|
-
</div>
|
132
|
-
|
133
|
-
</section>
|
134
|
-
|
135
|
-
</section>
|
136
|
-
</main>
|
137
|
-
|
138
|
-
|
139
|
-
<footer id="validator-badges" role="contentinfo">
|
140
|
-
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
141
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.6.2.
|
142
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
143
|
-
</footer>
|
144
|
-
|
data/doc/GETTING-STARTED_md.html
DELETED
@@ -1,186 +0,0 @@
|
|
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-Demo+Application">Demo Application</a>
|
70
|
-
<li> <a href="#label-Configuration">Configuration</a>
|
71
|
-
|
72
|
-
</ul>
|
73
|
-
</details>
|
74
|
-
</li>
|
75
|
-
|
76
|
-
</ul>
|
77
|
-
</div>
|
78
|
-
|
79
|
-
|
80
|
-
<div id="project-metadata">
|
81
|
-
|
82
|
-
<div id="fileindex-section" class="nav-section">
|
83
|
-
<h3>Pages</h3>
|
84
|
-
|
85
|
-
<ul class="link-list">
|
86
|
-
<li><a href="./CHANGELOG_md.html">CHANGELOG</a>
|
87
|
-
<li><a href="./CODE_OF_CONDUCT_md.html">CODE_OF_CONDUCT</a>
|
88
|
-
<li><a href="./CONSIDERTIONS_md.html">CONSIDERTIONS</a>
|
89
|
-
<li><a href="./GETTING-STARTED_md.html">GETTING-STARTED</a>
|
90
|
-
<li><a href="./Gemfile.html">Gemfile</a>
|
91
|
-
<li><a href="./Gemfile_lock.html">Gemfile.lock</a>
|
92
|
-
<li><a href="./LICENSE_txt.html">LICENSE</a>
|
93
|
-
<li><a href="./README_md.html">README</a>
|
94
|
-
<li><a href="./ROADMAP_md.html">ROADMAP</a>
|
95
|
-
<li><a href="./Rakefile.html">Rakefile</a>
|
96
|
-
<li><a href="./bin/setup.html">setup</a>
|
97
|
-
<li><a href="./notes/CHEAT_SHEET_md.html">CHEAT_SHEET</a>
|
98
|
-
<li><a href="./sig/loggable_activity_rbs.html">loggable_activity.rbs</a>
|
99
|
-
</ul>
|
100
|
-
</div>
|
101
|
-
|
102
|
-
</div>
|
103
|
-
</nav>
|
104
|
-
|
105
|
-
<main role="main" aria-label="Page GETTING-STARTED.md">
|
106
|
-
|
107
|
-
<h1 id="label-Getting+started">Getting started<span><a href="#label-Getting+started">¶</a> <a href="#top">↑</a></span></h1>
|
108
|
-
|
109
|
-
<p>This document should you getting started with <code>LoggableActivity</code></p>
|
110
|
-
|
111
|
-
<h2 id="label-Prerequisite">Prerequisite<span><a href="#label-Prerequisite">¶</a> <a href="#top">↑</a></span></h2>
|
112
|
-
|
113
|
-
<p>1 A running Rails Application<br/> 2 An authorization system where there is a current user available.</p>
|
114
|
-
|
115
|
-
<h2 id="label-Demo+Application">Demo Application<span><a href="#label-Demo+Application">¶</a> <a href="#top">↑</a></span></h2>
|
116
|
-
|
117
|
-
<p>You can download a demo application from<br/> <a href="https://github.com/maxgronlund/LoggableActivityDemoApp">github.com/maxgronlund/LoggableActivityDemoApp</a></p>
|
118
|
-
|
119
|
-
<h2 id="label-Configuration">Configuration<span><a href="#label-Configuration">¶</a> <a href="#top">↑</a></span></h2>
|
120
|
-
|
121
|
-
<p>First you have to create a configuration file named <code>loggable_activity.yml</code> and locate it in the config folder.<br/> It has the following tags - <code>User</code> (example)<br> This is the name of the model you are configuring, as you can see there is alos a <code>Demo::Address</code> in the configuration file below, So if you have a model named <code>Demo::Club</code> you have to create at tag for that and fill in the other tags under that. - record_display_name: <br> Used to display something human to identify a given log entry, in this example the <strong>User</strong> model has a method named <code>full_name</code></p>
|
122
|
-
<ul><li>
|
123
|
-
<p>loggable_attrs:<br/> This are the attributes on a model and reflect the fields in the database you HAS to define, what fields to log.</p>
|
124
|
-
</li><li>
|
125
|
-
<p>auto_log:<br/> This are the actions that will be logged automatically, although you can log manually at any time. Note there is no hook for <code>Show</code> in Rails so you would have to log that manually like this <code>log(:show)</code>, more about that later.</p>
|
126
|
-
</li><li>
|
127
|
-
<p>relations:<br/> If a model has <code>belongs_to</code> and <code>has_one</code> relations you can log them automatically as well<br> <br/> <em>Example confuguration for logging of the user model</em></p>
|
128
|
-
|
129
|
-
<pre>User:
|
130
|
-
record_display_name: full_name
|
131
|
-
loggable_attrs:
|
132
|
-
|
133
|
-
- first_name
|
134
|
-
- last_name
|
135
|
-
auto_log:
|
136
|
-
- create
|
137
|
-
- update
|
138
|
-
- destroy
|
139
|
-
relations:
|
140
|
-
- belongs_to: :demo_address
|
141
|
-
model: Demo::Address
|
142
|
-
loggable_attrs:
|
143
|
-
- street
|
144
|
-
- city
|
145
|
-
Demo::Address:
|
146
|
-
record_display_name: full_address
|
147
|
-
actor_display_name: email
|
148
|
-
loggable_attrs:
|
149
|
-
- street
|
150
|
-
- city
|
151
|
-
- country
|
152
|
-
- postal_code</pre>
|
153
|
-
|
154
|
-
<p>Then you HAVE TO to add <code>LogggableActivity::Hooks</code> to the <code>User Model</code> like this</p>
|
155
|
-
</li></ul>
|
156
|
-
|
157
|
-
<pre>class User < ApplicationRecord
|
158
|
-
include LoggableActivity::Hooks
|
159
|
-
...</pre>
|
160
|
-
|
161
|
-
<p>And finally you have to add this to the <code>ApplicationController</code></p>
|
162
|
-
|
163
|
-
<pre>class ApplicationController < ActionController::Base
|
164
|
-
include LoggableActivity::CurrentUser</pre>
|
165
|
-
|
166
|
-
<p>Now if you create a model like this:</p>
|
167
|
-
|
168
|
-
<pre>$ rails c
|
169
|
-
$ User.create(first_name: 'John', last_name: 'Doe')</pre>
|
170
|
-
|
171
|
-
<p>Then an <code>LoggableActivity::Activity</code> is created. You can inspect it from the terminal like this.</p>
|
172
|
-
|
173
|
-
<pre class="ruby"><span class="ruby-identifier">puts</span> <span class="ruby-identifier">activity</span> = <span class="ruby-constant">Loggable</span><span class="ruby-operator">::</span><span class="ruby-constant">Activity</span>.<span class="ruby-identifier">last</span>
|
174
|
-
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">activity</span>.<span class="ruby-identifier">attrs</span>
|
175
|
-
</pre>
|
176
|
-
|
177
|
-
</main>
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
<footer id="validator-badges" role="contentinfo">
|
182
|
-
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
183
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.6.2.
|
184
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
185
|
-
</footer>
|
186
|
-
|
data/doc/Gemfile.html
DELETED
@@ -1,104 +0,0 @@
|
|
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="./CODE_OF_CONDUCT_md.html">CODE_OF_CONDUCT</a>
|
66
|
-
<li><a href="./CONSIDERTIONS_md.html">CONSIDERTIONS</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="./LICENSE_txt.html">LICENSE</a>
|
71
|
-
<li><a href="./README_md.html">README</a>
|
72
|
-
<li><a href="./ROADMAP_md.html">ROADMAP</a>
|
73
|
-
<li><a href="./Rakefile.html">Rakefile</a>
|
74
|
-
<li><a href="./bin/setup.html">setup</a>
|
75
|
-
<li><a href="./notes/CHEAT_SHEET_md.html">CHEAT_SHEET</a>
|
76
|
-
<li><a href="./sig/loggable_activity_rbs.html">loggable_activity.rbs</a>
|
77
|
-
</ul>
|
78
|
-
</div>
|
79
|
-
|
80
|
-
</div>
|
81
|
-
</nav>
|
82
|
-
|
83
|
-
<main role="main" aria-label="Page Gemfile">
|
84
|
-
|
85
|
-
<p># frozen_string_literal: true</p>
|
86
|
-
|
87
|
-
<p>source ‘<a href="https://rubygems.org">rubygems.org</a>’</p>
|
88
|
-
|
89
|
-
<p># Specify your gem’s dependencies in loggable_activity.gemspec gemspec</p>
|
90
|
-
|
91
|
-
<p>gem ‘rake’, ‘~> 13.0’</p>
|
92
|
-
|
93
|
-
<p># gem ‘rspec’, ‘~> 3.0’</p>
|
94
|
-
|
95
|
-
</main>
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
<footer id="validator-badges" role="contentinfo">
|
100
|
-
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
101
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.6.2.
|
102
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
103
|
-
</footer>
|
104
|
-
|