effective_logging 4.0.0 → 4.1.0

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
  SHA256:
3
- metadata.gz: 07b93fb924886c7eb67bebfa52af0ebba0955dcf70f882631b20b6c8d1ad4561
4
- data.tar.gz: af822e66e051e26100da80e9edab36e0c3665922924fadae8d2d8a9f0a34eed4
3
+ metadata.gz: 1e01f3b3cf8eef9efac4f4632689436b4af1a306d404751c8bb7ef3a4b0bfaac
4
+ data.tar.gz: d202700416cfc326a4629308efe158a22f86ced2b338cf73992ec4b711991fb7
5
5
  SHA512:
6
- metadata.gz: 39fca8a1eb4fe170a48c4e588d711cdee34cbd5999f05220a905e308e346ce80c2ece0bb840b480d67c11f43cd7f5215c009e32f1e13bf15c3526dab20a790f8
7
- data.tar.gz: aff176f1e23569d3f91a6e3b9c59bf3d8636efb753ae32dee906937db304769230762f85df3ef986cfc6b461c3251233e2affe8c6cd5887fd249b7167a0656fc
6
+ metadata.gz: 6e8bc213d1d252c3f1b52af723f4ff49f134d159bc1d48f4e6213e75257596c0426dc7b2e0f319b047436662bd93a71deadc271a31dac91a26fb2e45ec954149
7
+ data.tar.gz: 6ce20cf20608edc2aba0c6145c44cb8ee7cbddc02b39324852f632763b2553fe4d553e9345249fe12917a38b33c91819fe980364222120be1d4b1be9c83daa00
@@ -1,6 +1,6 @@
1
1
  module Effective
2
2
  class Log < ActiveRecord::Base
3
- self.table_name = EffectiveLogging.logs_table_name.to_s
3
+ self.table_name = (EffectiveLogging.logs_table_name || :logs).to_s
4
4
 
5
5
  effective_logging_log
6
6
  end
@@ -1,7 +1,4 @@
1
1
  EffectiveLogging.setup do |config|
2
- # Configure Database Tables
3
- config.logs_table_name = :logs
4
-
5
2
  # Specify Log class
6
3
  # config.log_class_name = 'Effective::Log'
7
4
 
@@ -0,0 +1,34 @@
1
+ class CreateEffectiveLogging < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :logs do |t|
4
+ t.string :status
5
+
6
+ t.string :user_type
7
+ t.integer :user_id
8
+
9
+ t.string :changes_to_type
10
+ t.integer :changes_to_id
11
+
12
+ t.string :associated_type
13
+ t.integer :associated_id
14
+ t.string :associated_to_s
15
+
16
+ t.text :message
17
+ t.text :details
18
+
19
+ t.timestamps
20
+ end
21
+
22
+ add_index :logs, :id, order: { id: :desc }
23
+ add_index :logs, :updated_at
24
+ add_index :logs, :user_id
25
+ add_index :logs, :status
26
+ add_index :logs, :associated_to_s
27
+ add_index :logs, [:associated_type, :associated_id]
28
+ add_index :logs, [:changes_to_type, :changes_to_id]
29
+
30
+ enable_extension('pg_trgm')
31
+ add_index :logs, :message, using: :gin, opclass: :gin_trgm_ops
32
+ add_index :logs, :details, using: :gin, opclass: :gin_trgm_ops
33
+ end
34
+ end
@@ -1,3 +1,3 @@
1
1
  module EffectiveLogging
2
- VERSION = '4.0.0'.freeze
2
+ VERSION = '4.1.0'.freeze
3
3
  end
@@ -20,9 +20,7 @@ module EffectiveLogging
20
20
  end
21
21
 
22
22
  def create_migration_file
23
- @logs_table_name = ':' + EffectiveLogging.logs_table_name.to_s
24
-
25
- migration_template ('../' * 3) + 'db/migrate/01_create_effective_logging.rb.erb', 'db/migrate/create_effective_logging.rb'
23
+ migration_template ('../' * 3) + 'db/migrate/101_create_effective_logging.rb', 'db/migrate/create_effective_logging.rb'
26
24
  end
27
25
  end
28
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-29 00:00:00.000000000 Z
11
+ date: 2023-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -80,6 +80,90 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: sqlite3
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: devise
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: pry-byebug
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: effective_test_bot
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: effective_developer
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: psych
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "<"
158
+ - !ruby/object:Gem::Version
159
+ version: '4'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "<"
165
+ - !ruby/object:Gem::Version
166
+ version: '4'
83
167
  description: Automatically log all sent emails, user logins, and page views. This
84
168
  also will log custom events from Ruby and JavaScript.
85
169
  email:
@@ -111,7 +195,7 @@ files:
111
195
  - app/views/effective/logs/show.html.haml
112
196
  - config/effective_logging.rb
113
197
  - config/routes.rb
114
- - db/migrate/01_create_effective_logging.rb.erb
198
+ - db/migrate/101_create_effective_logging.rb
115
199
  - lib/effective_logging.rb
116
200
  - lib/effective_logging/active_record_logger.rb
117
201
  - lib/effective_logging/active_storage_logger.rb
@@ -141,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
225
  - !ruby/object:Gem::Version
142
226
  version: '0'
143
227
  requirements: []
144
- rubygems_version: 3.4.10
228
+ rubygems_version: 3.3.7
145
229
  signing_key:
146
230
  specification_version: 4
147
231
  summary: Automatically log all sent emails, user logins, and page views. This also
@@ -1,38 +0,0 @@
1
- class CreateEffectiveLogging < ActiveRecord::Migration[4.2]
2
- def self.up
3
- create_table <%= @logs_table_name %> do |t|
4
- t.string :status
5
-
6
- t.string :user_type
7
- t.integer :user_id
8
-
9
- t.string :changes_to_type
10
- t.integer :changes_to_id
11
-
12
- t.string :associated_type
13
- t.integer :associated_id
14
- t.string :associated_to_s
15
-
16
- t.text :message
17
- t.text :details
18
-
19
- t.timestamps
20
- end
21
-
22
- add_index <%= @logs_table_name %>, :id, order: { id: :desc }
23
- add_index <%= @logs_table_name %>, :updated_at
24
- add_index <%= @logs_table_name %>, :user_id
25
- add_index <%= @logs_table_name %>, :status
26
- add_index <%= @logs_table_name %>, :associated_to_s
27
- add_index <%= @logs_table_name %>, [:associated_type, :associated_id]
28
- add_index <%= @logs_table_name %>, [:changes_to_type, :changes_to_id]
29
-
30
- enable_extension('pg_trgm')
31
- add_index <%= @logs_table_name %>, :message, using: :gin, opclass: :gin_trgm_ops
32
- add_index <%= @logs_table_name %>, :details, using: :gin, opclass: :gin_trgm_ops
33
- end
34
-
35
- def self.down
36
- drop_table <%= @logs_table_name %>
37
- end
38
- end