journaled 4.2.0 → 5.1.0
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/README.md +148 -46
- data/app/jobs/journaled/delivery_job.rb +17 -28
- data/app/models/concerns/journaled/changes.rb +1 -1
- data/app/models/journaled/audit_log/event.rb +87 -0
- data/app/models/journaled/event.rb +1 -1
- data/app/models/journaled/writer.rb +31 -15
- data/journaled_schemas/journaled/audit_log/event.json +31 -0
- data/lib/journaled/audit_log.rb +194 -0
- data/lib/journaled/connection.rb +48 -0
- data/lib/journaled/engine.rb +5 -0
- data/lib/journaled/errors.rb +3 -0
- data/lib/journaled/rspec.rb +86 -0
- data/lib/journaled/transaction_ext.rb +31 -0
- data/lib/journaled/version.rb +1 -1
- data/lib/journaled.rb +17 -11
- metadata +43 -84
- data/spec/dummy/README.rdoc +0 -28
- data/spec/dummy/Rakefile +0 -6
- data/spec/dummy/bin/bundle +0 -3
- data/spec/dummy/bin/rails +0 -4
- data/spec/dummy/bin/rake +0 -4
- data/spec/dummy/config/application.rb +0 -25
- data/spec/dummy/config/boot.rb +0 -5
- data/spec/dummy/config/database.yml +0 -6
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -24
- data/spec/dummy/config/environments/test.rb +0 -37
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/cookies_serializer.rb +0 -3
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/dummy/config/initializers/inflections.rb +0 -16
- data/spec/dummy/config/initializers/mime_types.rb +0 -4
- data/spec/dummy/config/initializers/session_store.rb +0 -3
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy/config/locales/en.yml +0 -23
- data/spec/dummy/config/routes.rb +0 -56
- data/spec/dummy/config/secrets.yml +0 -22
- data/spec/dummy/config.ru +0 -4
- data/spec/dummy/db/schema.rb +0 -18
- data/spec/dummy/public/404.html +0 -67
- data/spec/dummy/public/422.html +0 -67
- data/spec/dummy/public/500.html +0 -66
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/jobs/journaled/delivery_job_spec.rb +0 -276
- data/spec/lib/journaled_spec.rb +0 -89
- data/spec/models/concerns/journaled/actor_spec.rb +0 -47
- data/spec/models/concerns/journaled/changes_spec.rb +0 -106
- data/spec/models/database_change_protection_spec.rb +0 -109
- data/spec/models/journaled/actor_uri_provider_spec.rb +0 -42
- data/spec/models/journaled/change_writer_spec.rb +0 -281
- data/spec/models/journaled/event_spec.rb +0 -236
- data/spec/models/journaled/json_schema_model/validator_spec.rb +0 -133
- data/spec/models/journaled/writer_spec.rb +0 -174
- data/spec/rails_helper.rb +0 -19
- data/spec/spec_helper.rb +0 -24
- data/spec/support/environment_spec_helper.rb +0 -16
@@ -0,0 +1,48 @@
|
|
1
|
+
module Journaled
|
2
|
+
module Connection
|
3
|
+
class << self
|
4
|
+
def available?
|
5
|
+
Journaled.transactional_batching_enabled && transaction_open?
|
6
|
+
end
|
7
|
+
|
8
|
+
def stage!(event)
|
9
|
+
raise TransactionSafetyError, <<~MSG unless transaction_open?
|
10
|
+
Transaction not available! By default, journaled event batching requires an open database transaction.
|
11
|
+
MSG
|
12
|
+
|
13
|
+
connection.current_transaction._journaled_staged_events << event
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def transaction_open?
|
19
|
+
connection.transaction_open?
|
20
|
+
end
|
21
|
+
|
22
|
+
def connection
|
23
|
+
if Journaled.queue_adapter.in? %w(delayed delayed_job)
|
24
|
+
Delayed::Job.connection
|
25
|
+
elsif Journaled.queue_adapter == 'good_job'
|
26
|
+
GoodJob::BaseRecord.connection
|
27
|
+
elsif Journaled.queue_adapter == 'que'
|
28
|
+
Que::ActiveRecord::Model.connection
|
29
|
+
elsif Journaled.queue_adapter == 'test' && Rails.env.test?
|
30
|
+
ActiveRecord::Base.connection
|
31
|
+
else
|
32
|
+
raise "Unsupported adapter: #{Journaled.queue_adapter}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
module TestOnlyBehaviors
|
38
|
+
def transaction_open?
|
39
|
+
# Transactional fixtures wrap all tests in an outer, non-joinable transaction:
|
40
|
+
super && (connection.open_transactions > 1 || connection.current_transaction.joinable?)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
class << self
|
45
|
+
prepend TestOnlyBehaviors if Rails.env.test?
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/lib/journaled/engine.rb
CHANGED
@@ -4,6 +4,11 @@ module Journaled
|
|
4
4
|
ActiveSupport.on_load(:active_job) do
|
5
5
|
Journaled.detect_queue_adapter! unless Journaled.development_or_test?
|
6
6
|
end
|
7
|
+
|
8
|
+
ActiveSupport.on_load(:active_record) do
|
9
|
+
require 'journaled/transaction_ext'
|
10
|
+
ActiveRecord::ConnectionAdapters::Transaction.prepend Journaled::TransactionExt
|
11
|
+
end
|
7
12
|
end
|
8
13
|
end
|
9
14
|
end
|
data/lib/journaled/rspec.rb
CHANGED
@@ -16,3 +16,89 @@ RSpec::Matchers.define :journal_changes_to do |*attribute_names, as:|
|
|
16
16
|
"expected #{model_class} not to journal changes to #{attribute_names.map(&:inspect).join(', ')} as #{as.inspect}"
|
17
17
|
end
|
18
18
|
end
|
19
|
+
|
20
|
+
RSpec::Matchers.define_negated_matcher :not_journal_changes_to, :journal_changes_to
|
21
|
+
|
22
|
+
RSpec::Matchers.define :journal_events_including do |*expected_events|
|
23
|
+
raise "Please specify at least one expected event. RSpec argument matchers are supported." if expected_events.empty?
|
24
|
+
|
25
|
+
attr_accessor :expected, :actual, :matches, :nonmatches
|
26
|
+
|
27
|
+
chain :with_schema_name, :expected_schema_name
|
28
|
+
chain :with_partition_key, :expected_partition_key
|
29
|
+
chain :with_stream_name, :expected_stream_name
|
30
|
+
chain :with_enqueue_opts, :expected_enqueue_opts
|
31
|
+
chain :with_priority, :expected_priority
|
32
|
+
|
33
|
+
def supports_block_expectations?
|
34
|
+
true
|
35
|
+
end
|
36
|
+
|
37
|
+
def hash_including_recursive(hash)
|
38
|
+
hash_including(
|
39
|
+
hash.transform_values { |v| v.is_a?(Hash) ? hash_including_recursive(v) : v },
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
43
|
+
match do |block|
|
44
|
+
expected_events = [expected_events.first].flatten(1) unless expected_events.length > 1
|
45
|
+
|
46
|
+
self.expected = expected_events.map { |e| { journaled_attributes: e } }
|
47
|
+
expected.each { |e| e.merge!(journaled_schema_name: expected_schema_name) } if expected_schema_name
|
48
|
+
expected.each { |e| e.merge!(journaled_partition_key: expected_partition_key) } if expected_partition_key
|
49
|
+
expected.each { |e| e.merge!(journaled_stream_name: expected_stream_name) } if expected_stream_name
|
50
|
+
expected.each { |e| e.merge!(journaled_enqueue_opts: expected_enqueue_opts) } if expected_enqueue_opts
|
51
|
+
expected.each { |e| e.merge!(priority: expected_priority) } if expected_priority
|
52
|
+
self.actual = []
|
53
|
+
|
54
|
+
callback = ->(_name, _started, _finished, _unique_id, payload) do
|
55
|
+
event = payload[:event]
|
56
|
+
a = { journaled_attributes: event.journaled_attributes }
|
57
|
+
a[:journaled_schema_name] = event.journaled_schema_name if expected_schema_name
|
58
|
+
a[:journaled_partition_key] = event.journaled_partition_key if expected_partition_key
|
59
|
+
a[:journaled_stream_name] = event.journaled_stream_name if expected_stream_name
|
60
|
+
a[:journaled_enqueue_opts] = event.journaled_enqueue_opts if expected_enqueue_opts
|
61
|
+
a[:priority] = payload[:priority] if expected_priority
|
62
|
+
actual << a
|
63
|
+
end
|
64
|
+
|
65
|
+
ActiveSupport::Notifications.subscribed(callback, 'journaled.event.enqueue', &block)
|
66
|
+
|
67
|
+
self.matches = actual.select do |a|
|
68
|
+
expected.any? { |e| values_match?(hash_including_recursive(e), a) }
|
69
|
+
end
|
70
|
+
|
71
|
+
self.nonmatches = actual - matches
|
72
|
+
|
73
|
+
exact_matches = matches.dup
|
74
|
+
matches.count == expected.count && expected.all? do |e|
|
75
|
+
match, index = exact_matches.each_with_index.find { |a, _| values_match?(hash_including_recursive(e), a) }
|
76
|
+
exact_matches.delete_at(index) if match
|
77
|
+
end && exact_matches.empty?
|
78
|
+
end
|
79
|
+
|
80
|
+
failure_message do
|
81
|
+
<<~MSG
|
82
|
+
Expected the code block to journal exactly one matching event per expected event.
|
83
|
+
|
84
|
+
Expected Events (#{expected.count}):
|
85
|
+
===============================================================================
|
86
|
+
#{expected.map(&:to_json).join("\n ")}
|
87
|
+
===============================================================================
|
88
|
+
|
89
|
+
Matching Events (#{matches.count}):
|
90
|
+
===============================================================================
|
91
|
+
#{matches.map(&:to_json).join("\n ")}
|
92
|
+
===============================================================================
|
93
|
+
|
94
|
+
Non-Matching Events (#{nonmatches.count}):
|
95
|
+
===============================================================================
|
96
|
+
#{nonmatches.map(&:to_json).join("\n ")}
|
97
|
+
===============================================================================
|
98
|
+
MSG
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
RSpec::Matchers.alias_matcher :journal_event_including, :journal_events_including
|
103
|
+
RSpec::Matchers.define_negated_matcher :not_journal_events_including, :journal_events_including
|
104
|
+
RSpec::Matchers.define_negated_matcher :not_journal_event_including, :journal_event_including
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'active_record/connection_adapters/abstract/transaction'
|
2
|
+
|
3
|
+
module Journaled
|
4
|
+
module TransactionExt
|
5
|
+
def initialize(*, **)
|
6
|
+
super.tap do
|
7
|
+
raise TransactionSafetyError, <<~MSG unless instance_variable_defined?(:@run_commit_callbacks)
|
8
|
+
Journaled::TransactionExt expects @run_commit_callbacks to be defined on Transaction!
|
9
|
+
This is an internal API that may have changed in a recent Rails release.
|
10
|
+
If you were not expecting to see this error, please file an issue here:
|
11
|
+
https://github.com/Betterment/journaled/issues
|
12
|
+
MSG
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def before_commit_records
|
17
|
+
super.tap do
|
18
|
+
Writer.enqueue!(*_journaled_staged_events) if @run_commit_callbacks
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def commit_records
|
23
|
+
connection.current_transaction._journaled_staged_events.push(*_journaled_staged_events) unless @run_commit_callbacks
|
24
|
+
super
|
25
|
+
end
|
26
|
+
|
27
|
+
def _journaled_staged_events
|
28
|
+
@_journaled_staged_events ||= []
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/journaled/version.rb
CHANGED
data/lib/journaled.rb
CHANGED
@@ -4,6 +4,8 @@ require "json-schema"
|
|
4
4
|
|
5
5
|
require "journaled/engine"
|
6
6
|
require "journaled/current"
|
7
|
+
require "journaled/errors"
|
8
|
+
require 'journaled/connection'
|
7
9
|
|
8
10
|
module Journaled
|
9
11
|
SUPPORTED_QUEUE_ADAPTERS = %w(delayed delayed_job good_job que).freeze
|
@@ -14,32 +16,36 @@ module Journaled
|
|
14
16
|
mattr_accessor(:http_open_timeout) { 2 }
|
15
17
|
mattr_accessor(:http_read_timeout) { 60 }
|
16
18
|
mattr_accessor(:job_base_class_name) { 'ActiveJob::Base' }
|
19
|
+
mattr_accessor(:transactional_batching_enabled) { true }
|
17
20
|
|
18
|
-
def development_or_test?
|
21
|
+
def self.development_or_test?
|
19
22
|
%w(development test).include?(Rails.env)
|
20
23
|
end
|
21
24
|
|
22
|
-
def enabled?
|
25
|
+
def self.enabled?
|
23
26
|
['0', 'false', false, 'f', ''].exclude?(ENV.fetch('JOURNALED_ENABLED', !development_or_test?))
|
24
27
|
end
|
25
28
|
|
26
|
-
def schema_providers
|
29
|
+
def self.schema_providers
|
27
30
|
@schema_providers ||= [Journaled::Engine, Rails]
|
28
31
|
end
|
29
32
|
|
30
|
-
def commit_hash
|
33
|
+
def self.commit_hash
|
31
34
|
ENV.fetch('GIT_COMMIT')
|
32
35
|
end
|
33
36
|
|
34
|
-
def actor_uri
|
37
|
+
def self.actor_uri
|
35
38
|
Journaled::ActorUriProvider.instance.actor_uri
|
36
39
|
end
|
37
40
|
|
38
|
-
def
|
39
|
-
|
40
|
-
|
41
|
+
def self.queue_adapter
|
42
|
+
job_base_class_name.constantize.queue_adapter_name
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.detect_queue_adapter!
|
46
|
+
unless SUPPORTED_QUEUE_ADAPTERS.include?(queue_adapter)
|
41
47
|
raise <<~MSG
|
42
|
-
Journaled has detected an unsupported ActiveJob queue adapter: `:#{
|
48
|
+
Journaled has detected an unsupported ActiveJob queue adapter: `:#{queue_adapter}`
|
43
49
|
|
44
50
|
Journaled jobs must be enqueued transactionally to your primary database.
|
45
51
|
|
@@ -62,6 +68,6 @@ module Journaled
|
|
62
68
|
def self.tag!(**tags)
|
63
69
|
Current.tags = Current.tags.merge(tags)
|
64
70
|
end
|
65
|
-
|
66
|
-
module_function :development_or_test?, :enabled?, :schema_providers, :commit_hash, :actor_uri, :detect_queue_adapter!
|
67
71
|
end
|
72
|
+
|
73
|
+
require 'journaled/audit_log'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: journaled
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jake Lipson
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2022-
|
14
|
+
date: 2022-09-09 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activejob
|
@@ -41,6 +41,20 @@ dependencies:
|
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: '0'
|
44
|
+
- !ruby/object:Gem::Dependency
|
45
|
+
name: activesupport
|
46
|
+
requirement: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '0'
|
51
|
+
type: :runtime
|
52
|
+
prerelease: false
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
44
58
|
- !ruby/object:Gem::Dependency
|
45
59
|
name: aws-sdk-kinesis
|
46
60
|
requirement: !ruby/object:Gem::Requirement
|
@@ -242,6 +256,7 @@ files:
|
|
242
256
|
- app/jobs/journaled/delivery_job.rb
|
243
257
|
- app/models/concerns/journaled/changes.rb
|
244
258
|
- app/models/journaled/actor_uri_provider.rb
|
259
|
+
- app/models/journaled/audit_log/event.rb
|
245
260
|
- app/models/journaled/change.rb
|
246
261
|
- app/models/journaled/change_definition.rb
|
247
262
|
- app/models/journaled/change_writer.rb
|
@@ -252,60 +267,44 @@ files:
|
|
252
267
|
- config/initializers/change_protection.rb
|
253
268
|
- config/spring.rb
|
254
269
|
- journaled_schemas/base_event.json
|
270
|
+
- journaled_schemas/journaled/audit_log/event.json
|
255
271
|
- journaled_schemas/journaled/change.json
|
256
272
|
- journaled_schemas/tagged_event.json
|
257
273
|
- lib/journaled.rb
|
274
|
+
- lib/journaled/audit_log.rb
|
275
|
+
- lib/journaled/connection.rb
|
258
276
|
- lib/journaled/current.rb
|
259
277
|
- lib/journaled/engine.rb
|
278
|
+
- lib/journaled/errors.rb
|
260
279
|
- lib/journaled/relation_change_protection.rb
|
261
280
|
- lib/journaled/rspec.rb
|
281
|
+
- lib/journaled/transaction_ext.rb
|
262
282
|
- lib/journaled/version.rb
|
263
|
-
- spec/dummy/README.rdoc
|
264
|
-
- spec/dummy/Rakefile
|
265
|
-
- spec/dummy/bin/bundle
|
266
|
-
- spec/dummy/bin/rails
|
267
|
-
- spec/dummy/bin/rake
|
268
|
-
- spec/dummy/config.ru
|
269
|
-
- spec/dummy/config/application.rb
|
270
|
-
- spec/dummy/config/boot.rb
|
271
|
-
- spec/dummy/config/database.yml
|
272
|
-
- spec/dummy/config/environment.rb
|
273
|
-
- spec/dummy/config/environments/development.rb
|
274
|
-
- spec/dummy/config/environments/test.rb
|
275
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
276
|
-
- spec/dummy/config/initializers/cookies_serializer.rb
|
277
|
-
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
278
|
-
- spec/dummy/config/initializers/inflections.rb
|
279
|
-
- spec/dummy/config/initializers/mime_types.rb
|
280
|
-
- spec/dummy/config/initializers/session_store.rb
|
281
|
-
- spec/dummy/config/initializers/wrap_parameters.rb
|
282
|
-
- spec/dummy/config/locales/en.yml
|
283
|
-
- spec/dummy/config/routes.rb
|
284
|
-
- spec/dummy/config/secrets.yml
|
285
|
-
- spec/dummy/db/schema.rb
|
286
|
-
- spec/dummy/public/404.html
|
287
|
-
- spec/dummy/public/422.html
|
288
|
-
- spec/dummy/public/500.html
|
289
|
-
- spec/dummy/public/favicon.ico
|
290
|
-
- spec/jobs/journaled/delivery_job_spec.rb
|
291
|
-
- spec/lib/journaled_spec.rb
|
292
|
-
- spec/models/concerns/journaled/actor_spec.rb
|
293
|
-
- spec/models/concerns/journaled/changes_spec.rb
|
294
|
-
- spec/models/database_change_protection_spec.rb
|
295
|
-
- spec/models/journaled/actor_uri_provider_spec.rb
|
296
|
-
- spec/models/journaled/change_writer_spec.rb
|
297
|
-
- spec/models/journaled/event_spec.rb
|
298
|
-
- spec/models/journaled/json_schema_model/validator_spec.rb
|
299
|
-
- spec/models/journaled/writer_spec.rb
|
300
|
-
- spec/rails_helper.rb
|
301
|
-
- spec/spec_helper.rb
|
302
|
-
- spec/support/environment_spec_helper.rb
|
303
283
|
homepage: http://github.com/Betterment/journaled
|
304
284
|
licenses:
|
305
285
|
- MIT
|
306
286
|
metadata:
|
307
287
|
rubygems_mfa_required: 'true'
|
308
|
-
post_install_message:
|
288
|
+
post_install_message: |+
|
289
|
+
============================
|
290
|
+
NOTE FOR UPGRADING JOURNALED
|
291
|
+
============================
|
292
|
+
|
293
|
+
If you are upgrading from an older `journaled` version, please be sure to
|
294
|
+
increment only ONE major version at a time.
|
295
|
+
|
296
|
+
⚠️ IF YOU ARE UPGRADING FROM 3.1 OR EARLIER, you should NOT USE THIS VERSION. ⚠️
|
297
|
+
|
298
|
+
Instead, install a version of the gem that is backwards compatible with your
|
299
|
+
app's currently-enqueued journaled jobs:
|
300
|
+
|
301
|
+
gem 'journaled', '~> 4.2.0' # upgrading from 3.0-3.1
|
302
|
+
gem 'journaled', '~> 3.1.0' # upgrading from 2.0-2.5
|
303
|
+
|
304
|
+
For additional upgrade instructions (e.g. how to handle a few BREAKING CHANGES
|
305
|
+
to environment variables), please see the README:
|
306
|
+
https://github.com/Betterment/journaled/blob/v5.0.0/README.md#upgrades
|
307
|
+
|
309
308
|
rdoc_options: []
|
310
309
|
require_paths:
|
311
310
|
- lib
|
@@ -324,44 +323,4 @@ rubygems_version: 3.3.5
|
|
324
323
|
signing_key:
|
325
324
|
specification_version: 4
|
326
325
|
summary: Journaling for Betterment apps.
|
327
|
-
test_files:
|
328
|
-
- spec/spec_helper.rb
|
329
|
-
- spec/dummy/bin/rake
|
330
|
-
- spec/dummy/bin/bundle
|
331
|
-
- spec/dummy/bin/rails
|
332
|
-
- spec/dummy/config/secrets.yml
|
333
|
-
- spec/dummy/config/routes.rb
|
334
|
-
- spec/dummy/config/locales/en.yml
|
335
|
-
- spec/dummy/config/environments/development.rb
|
336
|
-
- spec/dummy/config/environments/test.rb
|
337
|
-
- spec/dummy/config/environment.rb
|
338
|
-
- spec/dummy/config/application.rb
|
339
|
-
- spec/dummy/config/database.yml
|
340
|
-
- spec/dummy/config/boot.rb
|
341
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
342
|
-
- spec/dummy/config/initializers/mime_types.rb
|
343
|
-
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
344
|
-
- spec/dummy/config/initializers/session_store.rb
|
345
|
-
- spec/dummy/config/initializers/wrap_parameters.rb
|
346
|
-
- spec/dummy/config/initializers/cookies_serializer.rb
|
347
|
-
- spec/dummy/config/initializers/inflections.rb
|
348
|
-
- spec/dummy/config.ru
|
349
|
-
- spec/dummy/Rakefile
|
350
|
-
- spec/dummy/public/favicon.ico
|
351
|
-
- spec/dummy/public/422.html
|
352
|
-
- spec/dummy/public/500.html
|
353
|
-
- spec/dummy/public/404.html
|
354
|
-
- spec/dummy/db/schema.rb
|
355
|
-
- spec/dummy/README.rdoc
|
356
|
-
- spec/models/journaled/json_schema_model/validator_spec.rb
|
357
|
-
- spec/models/journaled/actor_uri_provider_spec.rb
|
358
|
-
- spec/models/journaled/event_spec.rb
|
359
|
-
- spec/models/journaled/change_writer_spec.rb
|
360
|
-
- spec/models/journaled/writer_spec.rb
|
361
|
-
- spec/models/database_change_protection_spec.rb
|
362
|
-
- spec/models/concerns/journaled/changes_spec.rb
|
363
|
-
- spec/models/concerns/journaled/actor_spec.rb
|
364
|
-
- spec/support/environment_spec_helper.rb
|
365
|
-
- spec/lib/journaled_spec.rb
|
366
|
-
- spec/jobs/journaled/delivery_job_spec.rb
|
367
|
-
- spec/rails_helper.rb
|
326
|
+
test_files: []
|
data/spec/dummy/README.rdoc
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
== README
|
2
|
-
|
3
|
-
This README would normally document whatever steps are necessary to get the
|
4
|
-
application up and running.
|
5
|
-
|
6
|
-
Things you may want to cover:
|
7
|
-
|
8
|
-
* Ruby version
|
9
|
-
|
10
|
-
* System dependencies
|
11
|
-
|
12
|
-
* Configuration
|
13
|
-
|
14
|
-
* Database creation
|
15
|
-
|
16
|
-
* Database initialization
|
17
|
-
|
18
|
-
* How to run the test suite
|
19
|
-
|
20
|
-
* Services (job queues, cache servers, search engines, etc.)
|
21
|
-
|
22
|
-
* Deployment instructions
|
23
|
-
|
24
|
-
* ...
|
25
|
-
|
26
|
-
|
27
|
-
Please feel free to use a different markup language if you do not plan to run
|
28
|
-
<tt>rake doc:app</tt>.
|
data/spec/dummy/Rakefile
DELETED
data/spec/dummy/bin/bundle
DELETED
data/spec/dummy/bin/rails
DELETED
data/spec/dummy/bin/rake
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
require File.expand_path('boot', __dir__)
|
2
|
-
|
3
|
-
require "active_record/railtie"
|
4
|
-
require "active_job/railtie"
|
5
|
-
require "active_model/railtie"
|
6
|
-
require "action_controller/railtie"
|
7
|
-
|
8
|
-
Bundler.require(*Rails.groups)
|
9
|
-
require "journaled"
|
10
|
-
|
11
|
-
module Dummy
|
12
|
-
class Application < Rails::Application
|
13
|
-
# Settings in config/environments/* take precedence over those specified here.
|
14
|
-
# Application configuration should go into files in config/initializers
|
15
|
-
# -- all .rb files in that directory are automatically loaded.
|
16
|
-
|
17
|
-
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
18
|
-
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
19
|
-
# config.time_zone = 'Central Time (US & Canada)'
|
20
|
-
|
21
|
-
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
22
|
-
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
23
|
-
# config.i18n.default_locale = :de
|
24
|
-
end
|
25
|
-
end
|
data/spec/dummy/config/boot.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
Rails.application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
-
|
4
|
-
# In the development environment your application's code is reloaded on
|
5
|
-
# every request. This slows down response time but is perfect for development
|
6
|
-
# since you don't have to restart the web server when you make code changes.
|
7
|
-
config.cache_classes = false
|
8
|
-
|
9
|
-
# Do not eager load code on boot.
|
10
|
-
config.eager_load = false
|
11
|
-
|
12
|
-
# Show full error reports and disable caching.
|
13
|
-
config.consider_all_requests_local = true
|
14
|
-
config.action_controller.perform_caching = false
|
15
|
-
|
16
|
-
# Print deprecation notices to the Rails logger.
|
17
|
-
config.active_support.deprecation = :log
|
18
|
-
|
19
|
-
# Raise an error on page load if there are pending migrations.
|
20
|
-
config.active_record.migration_error = :page_load
|
21
|
-
|
22
|
-
# Raises error for missing translations
|
23
|
-
# config.action_view.raise_on_missing_translations = true
|
24
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
Rails.application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
-
|
4
|
-
# The test environment is used exclusively to run your application's
|
5
|
-
# test suite. You never need to work with it otherwise. Remember that
|
6
|
-
# your test database is "scratch space" for the test suite and is wiped
|
7
|
-
# and recreated between test runs. Don't rely on the data there!
|
8
|
-
config.cache_classes = true
|
9
|
-
|
10
|
-
# Do not eager load code on boot. This avoids loading your whole application
|
11
|
-
# just for the purpose of running a single test. If you are using a tool that
|
12
|
-
# preloads Rails for running tests, you may have to set it to true.
|
13
|
-
config.eager_load = false
|
14
|
-
|
15
|
-
# Configure static asset server for tests with Cache-Control for performance.
|
16
|
-
config.serve_static_assets = true
|
17
|
-
config.static_cache_control = 'public, max-age=3600'
|
18
|
-
|
19
|
-
# Show full error reports and disable caching.
|
20
|
-
config.consider_all_requests_local = true
|
21
|
-
config.action_controller.perform_caching = false
|
22
|
-
|
23
|
-
# Raise exceptions instead of rendering exception templates.
|
24
|
-
config.action_dispatch.show_exceptions = false
|
25
|
-
|
26
|
-
# Disable request forgery protection in test environment.
|
27
|
-
config.action_controller.allow_forgery_protection = false
|
28
|
-
|
29
|
-
# Print deprecation notices to the stderr.
|
30
|
-
config.active_support.deprecation = :stderr
|
31
|
-
|
32
|
-
# Raises error for missing translations
|
33
|
-
# config.action_view.raise_on_missing_translations = true
|
34
|
-
|
35
|
-
# Use ActiveJob test adapter
|
36
|
-
config.active_job.queue_adapter = :test
|
37
|
-
end
|
@@ -1,7 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
-
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
|
-
|
6
|
-
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
7
|
-
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# Add new inflection rules using the following format. Inflections
|
4
|
-
# are locale specific, and you may define rules for as many different
|
5
|
-
# locales as you wish. All of these examples are active by default:
|
6
|
-
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
7
|
-
# inflect.plural /^(ox)$/i, '\1en'
|
8
|
-
# inflect.singular /^(ox)en/i, '\1'
|
9
|
-
# inflect.irregular 'person', 'people'
|
10
|
-
# inflect.uncountable %w( fish sheep )
|
11
|
-
# end
|
12
|
-
|
13
|
-
# These inflection rules are supported but not enabled by default:
|
14
|
-
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
15
|
-
# inflect.acronym 'RESTful'
|
16
|
-
# end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
-
# is enabled by default.
|
5
|
-
|
6
|
-
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
-
ActiveSupport.on_load(:action_controller) do
|
8
|
-
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
9
|
-
end
|
10
|
-
|
11
|
-
# To enable root element in JSON for ActiveRecord objects.
|
12
|
-
# ActiveSupport.on_load(:active_record) do
|
13
|
-
# self.include_root_in_json = true
|
14
|
-
# end
|