sequel_audited 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 588936fb470f24b13cc2c4a2bb428ebca0c9b6ba
4
- data.tar.gz: 40f529bdd54785950add19fba2edde881aff4297
3
+ metadata.gz: ff58cb99b94d066607cbbfe4871a49fc304fa7d9
4
+ data.tar.gz: 4125a2f37a0dc1dba0b36c6871b2501a54cb7569
5
5
  SHA512:
6
- metadata.gz: 7d999de849aaae4777e095be1390c34aedd917d18c6731d643554d85f3bac48fddee225426647cb48dba59574d4d0ea3a9d858166d67926566740d5f0315da8b
7
- data.tar.gz: da89ba1160221b66ed8c23151da6a6cd47a2d7ef2e98cc50a57f8aed6b3ea2b09eaca0ef09a64732b515b96dbfe7673320116fcd1d530f4eb49d955bb1744fa5
6
+ metadata.gz: e69aa43e8347cdb92425864573713373e2230305930692b1a390d5674f763cb3e656886f29f65817ae6cb06b5fc201920961851c44c6fe5ee4c761e54631be85
7
+ data.tar.gz: 01051cd08db1ef8595101a86a8ad7b9e87b714d6f10a88081e8e717f118a24351c24919bdcac95cbfb777a9ac5ad7545a0efe36db9195a10690b118c3a9f3198
data/README.md CHANGED
@@ -63,14 +63,14 @@ which should output something like this:
63
63
 
64
64
  ```bash
65
65
  ....
66
- rake audited:add_migration # Installs Sequel::Audited migration, but does not run it.
66
+ rake audited:migrate:install # Installs Sequel::Audited migration, but does not run it.
67
67
  ....
68
68
  ```
69
69
 
70
70
  Run the sequel_audit rake task:
71
71
 
72
72
  ```bash
73
- bundle exec rake audited:add_migration
73
+ bundle exec rake audited:migrate:install
74
74
  ```
75
75
  After this you can comment out the rake task in your Rakefile until you need to update. And then
76
76
  finally run db:migrate to update your DB.
@@ -5,7 +5,7 @@ module Sequel
5
5
  #
6
6
  module Audited
7
7
 
8
- VERSION = '0.2.0'
8
+ VERSION = '0.2.1'
9
9
 
10
10
  end
11
11
  end
@@ -1,3 +1,5 @@
1
+ require_relative '../audited'
2
+
1
3
  class AuditLog < Sequel::Model
2
4
  # handle versioning of audited records
3
5
  plugin :list, field: :version, scope: [:associated_type, :associated_id]
@@ -1,23 +1,17 @@
1
1
  Sequel.migration do
2
2
  # created by sequel-audited gem
3
3
 
4
- up do
4
+ change do
5
5
  create_table(:audit_logs) do
6
6
  primary_key :id
7
- String :model_type
8
- Integer :model_pk
9
- String :model_ref
7
+ String :associated_type
8
+ Integer :associated_id
10
9
  String :event
11
10
  String :changed, text: true
12
11
  Integer :version, default: 0
13
- Integer :user_id
14
- String :username
15
- String :user_type, default: 'User'
12
+ Integer :modifier_id
13
+ String :modifier_type, default: 'User'
16
14
  DateTime :created_at
17
15
  end
18
16
  end
19
-
20
- down do
21
- drop_table :audit_logs
22
- end
23
17
  end
@@ -6,44 +6,22 @@ require 'sequel/audited/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'sequel_audited'
8
8
  spec.version = Sequel::Audited::VERSION
9
- spec.authors = ['Kematzy', 'jnylen']
9
+ spec.authors = ['Kematzy', 'tohchye', 'jnylen']
10
10
  spec.email = ['me@jnylen.nu']
11
11
 
12
- spec.summary = %q{A Sequel plugin that logs changes made to an audited model, including who created, updated and destroyed the record, and what was changed and when the change was made}
12
+ spec.summary = %q{A Sequel plugin that logs changes made to an audited model, including who created, updated and destroyed the record, and what was changed and when the change was made.}
13
13
  spec.description = %q{A Sequel plugin that logs changes made to an audited model, including who created, updated and destroyed the record, and what was changed and when the change was made. This plugin provides model auditing (a.k.a: record versioning) for DB scenarios when DB triggers are not possible. (ie: on a web app on Heroku).}
14
14
  spec.homepage = 'https://github.com/jnylen/sequel_audited'
15
15
  spec.license = 'MIT'
16
16
 
17
- # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
18
- # delete this section to allow pushing this gem to any host.
19
- # if spec.respond_to?(:metadata)
20
- # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
21
- # else
22
- # raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
- # end
24
-
25
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
18
  spec.bindir = 'exe'
27
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
20
  spec.require_paths = ['lib']
29
21
 
30
22
  spec.add_runtime_dependency 'sequel', '~> 4.2'
31
- spec.add_runtime_dependency 'sequel_polymorphic'
32
- # spec.add_runtime_dependency 'pg' #, '~> 4.2'
33
-
34
- spec.add_development_dependency 'bundler', '~> 1.11'
35
- spec.add_development_dependency 'rake', '~> 10.0'
36
- spec.add_development_dependency 'minitest', '~> 5.0'
37
- spec.add_development_dependency 'minitest-rg'
38
- spec.add_development_dependency 'minitest-assert_errors'
39
- spec.add_development_dependency 'minitest-hooks'
40
- spec.add_development_dependency 'minitest-sequel'
23
+ spec.add_runtime_dependency 'sequel_polymorphic', '~> 0.3.1'
41
24
 
42
- spec.add_development_dependency 'pg'
43
- spec.add_development_dependency 'sqlite3'
44
25
 
45
- spec.add_development_dependency 'simplecov'
46
- spec.add_development_dependency 'rubocop'
47
- spec.add_development_dependency 'dotenv'
48
26
 
49
27
  end
metadata CHANGED
@@ -1,10 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel_audited
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kematzy
8
+ - tohchye
8
9
  - jnylen
9
10
  autorequire:
10
11
  bindir: exe
@@ -28,185 +29,17 @@ dependencies:
28
29
  - !ruby/object:Gem::Dependency
29
30
  name: sequel_polymorphic
30
31
  requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: '0'
35
- type: :runtime
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- version: '0'
42
- - !ruby/object:Gem::Dependency
43
- name: bundler
44
- requirement: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - "~>"
47
- - !ruby/object:Gem::Version
48
- version: '1.11'
49
- type: :development
50
- prerelease: false
51
- version_requirements: !ruby/object:Gem::Requirement
52
32
  requirements:
53
33
  - - "~>"
54
34
  - !ruby/object:Gem::Version
55
- version: '1.11'
56
- - !ruby/object:Gem::Dependency
57
- name: rake
58
- requirement: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - "~>"
61
- - !ruby/object:Gem::Version
62
- version: '10.0'
63
- type: :development
64
- prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - "~>"
68
- - !ruby/object:Gem::Version
69
- version: '10.0'
70
- - !ruby/object:Gem::Dependency
71
- name: minitest
72
- requirement: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - "~>"
75
- - !ruby/object:Gem::Version
76
- version: '5.0'
77
- type: :development
35
+ version: 0.3.1
36
+ type: :runtime
78
37
  prerelease: false
79
38
  version_requirements: !ruby/object:Gem::Requirement
80
39
  requirements:
81
40
  - - "~>"
82
41
  - !ruby/object:Gem::Version
83
- version: '5.0'
84
- - !ruby/object:Gem::Dependency
85
- name: minitest-rg
86
- requirement: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- version: '0'
91
- type: :development
92
- prerelease: false
93
- version_requirements: !ruby/object:Gem::Requirement
94
- requirements:
95
- - - ">="
96
- - !ruby/object:Gem::Version
97
- version: '0'
98
- - !ruby/object:Gem::Dependency
99
- name: minitest-assert_errors
100
- requirement: !ruby/object:Gem::Requirement
101
- requirements:
102
- - - ">="
103
- - !ruby/object:Gem::Version
104
- version: '0'
105
- type: :development
106
- prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - ">="
110
- - !ruby/object:Gem::Version
111
- version: '0'
112
- - !ruby/object:Gem::Dependency
113
- name: minitest-hooks
114
- requirement: !ruby/object:Gem::Requirement
115
- requirements:
116
- - - ">="
117
- - !ruby/object:Gem::Version
118
- version: '0'
119
- type: :development
120
- prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- requirements:
123
- - - ">="
124
- - !ruby/object:Gem::Version
125
- version: '0'
126
- - !ruby/object:Gem::Dependency
127
- name: minitest-sequel
128
- requirement: !ruby/object:Gem::Requirement
129
- requirements:
130
- - - ">="
131
- - !ruby/object:Gem::Version
132
- version: '0'
133
- type: :development
134
- prerelease: false
135
- version_requirements: !ruby/object:Gem::Requirement
136
- requirements:
137
- - - ">="
138
- - !ruby/object:Gem::Version
139
- version: '0'
140
- - !ruby/object:Gem::Dependency
141
- name: pg
142
- requirement: !ruby/object:Gem::Requirement
143
- requirements:
144
- - - ">="
145
- - !ruby/object:Gem::Version
146
- version: '0'
147
- type: :development
148
- prerelease: false
149
- version_requirements: !ruby/object:Gem::Requirement
150
- requirements:
151
- - - ">="
152
- - !ruby/object:Gem::Version
153
- version: '0'
154
- - !ruby/object:Gem::Dependency
155
- name: sqlite3
156
- requirement: !ruby/object:Gem::Requirement
157
- requirements:
158
- - - ">="
159
- - !ruby/object:Gem::Version
160
- version: '0'
161
- type: :development
162
- prerelease: false
163
- version_requirements: !ruby/object:Gem::Requirement
164
- requirements:
165
- - - ">="
166
- - !ruby/object:Gem::Version
167
- version: '0'
168
- - !ruby/object:Gem::Dependency
169
- name: simplecov
170
- requirement: !ruby/object:Gem::Requirement
171
- requirements:
172
- - - ">="
173
- - !ruby/object:Gem::Version
174
- version: '0'
175
- type: :development
176
- prerelease: false
177
- version_requirements: !ruby/object:Gem::Requirement
178
- requirements:
179
- - - ">="
180
- - !ruby/object:Gem::Version
181
- version: '0'
182
- - !ruby/object:Gem::Dependency
183
- name: rubocop
184
- requirement: !ruby/object:Gem::Requirement
185
- requirements:
186
- - - ">="
187
- - !ruby/object:Gem::Version
188
- version: '0'
189
- type: :development
190
- prerelease: false
191
- version_requirements: !ruby/object:Gem::Requirement
192
- requirements:
193
- - - ">="
194
- - !ruby/object:Gem::Version
195
- version: '0'
196
- - !ruby/object:Gem::Dependency
197
- name: dotenv
198
- requirement: !ruby/object:Gem::Requirement
199
- requirements:
200
- - - ">="
201
- - !ruby/object:Gem::Version
202
- version: '0'
203
- type: :development
204
- prerelease: false
205
- version_requirements: !ruby/object:Gem::Requirement
206
- requirements:
207
- - - ">="
208
- - !ruby/object:Gem::Version
209
- version: '0'
42
+ version: 0.3.1
210
43
  description: 'A Sequel plugin that logs changes made to an audited model, including
211
44
  who created, updated and destroyed the record, and what was changed and when the
212
45
  change was made. This plugin provides model auditing (a.k.a: record versioning)
@@ -257,5 +90,5 @@ signing_key:
257
90
  specification_version: 4
258
91
  summary: A Sequel plugin that logs changes made to an audited model, including who
259
92
  created, updated and destroyed the record, and what was changed and when the change
260
- was made
93
+ was made.
261
94
  test_files: []