mongo_trails 10.3.1 → 14.0.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/.github/workflows/test.yml +53 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +19 -0
- data/.ruby-version +1 -0
- data/Appraisals +10 -4
- data/Gemfile +8 -1
- data/README.md +27 -6
- data/Rakefile +17 -0
- data/gemfiles/rails_7.gemfile +15 -0
- data/gemfiles/rails_7.gemfile.lock +212 -0
- data/gemfiles/rails_8.gemfile +15 -0
- data/gemfiles/rails_8.gemfile.lock +213 -0
- data/gemfiles/rails_8_1.gemfile +15 -0
- data/gemfiles/rails_8_1.gemfile.lock +143 -0
- data/lib/mongo_trails/callback_propagation.rb +77 -0
- data/lib/mongo_trails/config.rb +7 -24
- data/lib/mongo_trails/events/base.rb +5 -308
- data/lib/mongo_trails/model_config.rb +1 -232
- data/lib/mongo_trails/mongo_support/config.rb +7 -1
- data/lib/mongo_trails/mongo_support/criteria.rb +7 -0
- data/lib/mongo_trails/mongo_support/version.rb +242 -19
- data/lib/mongo_trails/mongo_support/version_commit_wrap.rb +37 -0
- data/lib/mongo_trails/mongo_support/write_version_worker.rb +11 -0
- data/lib/mongo_trails/record_trail.rb +21 -262
- data/lib/mongo_trails/version.rb +5 -0
- data/lib/mongo_trails/version_concern.rb +4 -293
- data/lib/mongo_trails.rb +13 -149
- data/mongo_trails.gemspec +19 -20
- metadata +50 -85
- data/.travis.yml +0 -13
- data/Gemfile.lock +0 -62
- data/gemfiles/rails_5.gemfile +0 -9
- data/gemfiles/rails_5.gemfile.lock +0 -63
- data/gemfiles/rails_6.gemfile +0 -9
- data/gemfiles/rails_6.gemfile.lock +0 -63
- data/lib/mongo_trails/attribute_serializers/README.md +0 -10
- data/lib/mongo_trails/attribute_serializers/attribute_serializer_factory.rb +0 -27
- data/lib/mongo_trails/attribute_serializers/cast_attribute_serializer.rb +0 -51
- data/lib/mongo_trails/attribute_serializers/object_attribute.rb +0 -41
- data/lib/mongo_trails/attribute_serializers/object_changes_attribute.rb +0 -44
- data/lib/mongo_trails/cleaner.rb +0 -60
- data/lib/mongo_trails/compatibility.rb +0 -51
- data/lib/mongo_trails/events/create.rb +0 -32
- data/lib/mongo_trails/events/destroy.rb +0 -42
- data/lib/mongo_trails/events/update.rb +0 -60
- data/lib/mongo_trails/frameworks/cucumber.rb +0 -33
- data/lib/mongo_trails/frameworks/rails/controller.rb +0 -109
- data/lib/mongo_trails/frameworks/rails/engine.rb +0 -43
- data/lib/mongo_trails/frameworks/rails.rb +0 -4
- data/lib/mongo_trails/frameworks/rspec/helpers.rb +0 -29
- data/lib/mongo_trails/frameworks/rspec.rb +0 -43
- data/lib/mongo_trails/has_paper_trail.rb +0 -86
- data/lib/mongo_trails/queries/versions/where_object.rb +0 -65
- data/lib/mongo_trails/queries/versions/where_object_changes.rb +0 -75
- data/lib/mongo_trails/record_history.rb +0 -51
- data/lib/mongo_trails/reifier.rb +0 -130
- data/lib/mongo_trails/request.rb +0 -166
- data/lib/mongo_trails/serializers/json.rb +0 -46
- data/lib/mongo_trails/serializers/yaml.rb +0 -43
- data/lib/mongo_trails/type_serializers/postgres_array_serializer.rb +0 -48
- data/lib/mongo_trails/version_number.rb +0 -23
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module PaperTrail
|
|
4
|
-
module TypeSerializers
|
|
5
|
-
# Provides an alternative method of serialization
|
|
6
|
-
# and deserialization of PostgreSQL array columns.
|
|
7
|
-
class PostgresArraySerializer
|
|
8
|
-
def initialize(subtype, delimiter)
|
|
9
|
-
@subtype = subtype
|
|
10
|
-
@delimiter = delimiter
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def serialize(array)
|
|
14
|
-
return serialize_with_ar(array) if active_record_pre_502?
|
|
15
|
-
array
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def deserialize(array)
|
|
19
|
-
return deserialize_with_ar(array) if active_record_pre_502?
|
|
20
|
-
|
|
21
|
-
case array
|
|
22
|
-
# Needed for legacy reasons. If serialized array is a string
|
|
23
|
-
# then it was serialized with Rails < 5.0.2.
|
|
24
|
-
when ::String then deserialize_with_ar(array)
|
|
25
|
-
else array
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
private
|
|
30
|
-
|
|
31
|
-
def active_record_pre_502?
|
|
32
|
-
::ActiveRecord.gem_version < Gem::Version.new("5.0.2")
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def serialize_with_ar(array)
|
|
36
|
-
ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Array.
|
|
37
|
-
new(@subtype, @delimiter).
|
|
38
|
-
serialize(array)
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def deserialize_with_ar(array)
|
|
42
|
-
ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Array.
|
|
43
|
-
new(@subtype, @delimiter).
|
|
44
|
-
deserialize(array)
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
end
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module PaperTrail
|
|
4
|
-
# The version number of the paper_trail gem. Not to be confused with
|
|
5
|
-
# `PaperTrail::Version`. Ruby constants are case-sensitive, apparently,
|
|
6
|
-
# and they are two different modules! It would be nice to remove `VERSION`,
|
|
7
|
-
# because of this confusion, but it's not worth the breaking change.
|
|
8
|
-
# People are encouraged to use `PaperTrail.gem_version` instead.
|
|
9
|
-
module VERSION
|
|
10
|
-
MAJOR = 10
|
|
11
|
-
MINOR = 3
|
|
12
|
-
TINY = 1
|
|
13
|
-
|
|
14
|
-
# Set PRE to nil unless it's a pre-release (beta, rc, etc.)
|
|
15
|
-
PRE = nil
|
|
16
|
-
|
|
17
|
-
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".").freeze
|
|
18
|
-
|
|
19
|
-
def self.to_s
|
|
20
|
-
STRING
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|