paper_trail 9.0.2 → 9.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: 72cf4448b84e8e0f78e7be203e482f5c00b66801faa4a7ca518eb5e9676d97a7
4
- data.tar.gz: e884a18e85ac0ff2acc31f1a568c4c9b9356b0ae48c7d9eee138ff98ae02a25d
3
+ metadata.gz: 8b1d17dee8915123d498b23b4fd4f51dd2cc5ab99e42eafd9ab733fe7c0d00a5
4
+ data.tar.gz: 609410d97fa505e6b546d380a732110d668396043219a5142830dfb9c4f49658
5
5
  SHA512:
6
- metadata.gz: cab08ca6b72ae854eaf85e901f3c2ca090d70e04f32e65eb6f41fc6ee7699414ee5d7c889332b7d37f6a8f1ca82fa90394bee51f5d6ad7e25e9c7a440f5f3f00
7
- data.tar.gz: cda3a9f844b20d635f0bb1317a528301ed754f2ae8d45bcc4f8461d2abb8eda5b4e87b6298a0bfb873407195c9d427959267a161a5d0cd0ddf396270973f5d30
6
+ metadata.gz: 7ee084d32f06eca0ddf5c3b7ee32a740b170303935c0404c1a4e832770d162119a5f8cbb38449b1c63257a36ab10be430975cfae31354c0cb3f8aedd22656ca2
7
+ data.tar.gz: 6e4f92ef045868e5f71cc9856c3b51d4f0db33ed9436fddd71fe76f27b6b9f6591b3860ceee544b22b0d1e725a94c1d7cabb463634da97c47196bc74647ca4d2
@@ -45,7 +45,8 @@ module PaperTrail
45
45
  def create_initializer
46
46
  create_file(
47
47
  "config/initializers/paper_trail.rb",
48
- "PaperTrail.config.track_associations = #{!!options.with_associations?}\n"
48
+ "PaperTrail.config.track_associations = true\n",
49
+ "PaperTrail.config.association_reify_error_behaviour = :error"
49
50
  )
50
51
  end
51
52
 
@@ -26,7 +26,7 @@ module PaperTrail
26
26
  STR
27
27
 
28
28
  include Singleton
29
- attr_accessor :serializer, :version_limit
29
+ attr_accessor :serializer, :version_limit, :association_reify_error_behaviour
30
30
 
31
31
  def initialize
32
32
  # Variables which affect all threads, whose access is synchronized.
@@ -74,7 +74,18 @@ module PaperTrail
74
74
  when 1
75
75
  versions.first
76
76
  else
77
- raise FoundMoreThanOne.new(base_class_name, versions.length)
77
+ case PaperTrail.config.association_reify_error_behaviour.to_s
78
+ when "warn"
79
+ version = versions.first
80
+ version.logger&.warn(
81
+ FoundMoreThanOne.new(base_class_name, versions.length).message
82
+ )
83
+ version
84
+ when "ignore"
85
+ versions.first
86
+ else # "error"
87
+ raise FoundMoreThanOne.new(base_class_name, versions.length)
88
+ end
78
89
  end
79
90
  end
80
91
 
@@ -8,8 +8,10 @@ module PaperTrail
8
8
  # People are encouraged to use `PaperTrail.gem_version` instead.
9
9
  module VERSION
10
10
  MAJOR = 9
11
- MINOR = 0
12
- TINY = 2
11
+ MINOR = 1
12
+ TINY = 0
13
+
14
+ # Set PRE to nil unless it's a pre-release (beta, rc, etc.)
13
15
  PRE = nil
14
16
 
15
17
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".").freeze
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paper_trail
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.0.2
4
+ version: 9.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Stewart
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-05-15 00:00:00.000000000 Z
13
+ date: 2018-05-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -164,28 +164,28 @@ dependencies:
164
164
  requirements:
165
165
  - - "~>"
166
166
  - !ruby/object:Gem::Version
167
- version: 0.54.0
167
+ version: 0.56.0
168
168
  type: :development
169
169
  prerelease: false
170
170
  version_requirements: !ruby/object:Gem::Requirement
171
171
  requirements:
172
172
  - - "~>"
173
173
  - !ruby/object:Gem::Version
174
- version: 0.54.0
174
+ version: 0.56.0
175
175
  - !ruby/object:Gem::Dependency
176
176
  name: rubocop-rspec
177
177
  requirement: !ruby/object:Gem::Requirement
178
178
  requirements:
179
179
  - - "~>"
180
180
  - !ruby/object:Gem::Version
181
- version: 1.24.0
181
+ version: 1.25.1
182
182
  type: :development
183
183
  prerelease: false
184
184
  version_requirements: !ruby/object:Gem::Requirement
185
185
  requirements:
186
186
  - - "~>"
187
187
  - !ruby/object:Gem::Version
188
- version: 1.24.0
188
+ version: 1.25.1
189
189
  - !ruby/object:Gem::Dependency
190
190
  name: sqlite3
191
191
  requirement: !ruby/object:Gem::Requirement
@@ -200,20 +200,6 @@ dependencies:
200
200
  - - "~>"
201
201
  - !ruby/object:Gem::Version
202
202
  version: '1.3'
203
- - !ruby/object:Gem::Dependency
204
- name: timecop
205
- requirement: !ruby/object:Gem::Requirement
206
- requirements:
207
- - - "~>"
208
- - !ruby/object:Gem::Version
209
- version: 0.9.1
210
- type: :development
211
- prerelease: false
212
- version_requirements: !ruby/object:Gem::Requirement
213
- requirements:
214
- - - "~>"
215
- - !ruby/object:Gem::Version
216
- version: 0.9.1
217
203
  description: |
218
204
  Track changes to your models, for auditing or versioning. See how a model looked
219
205
  at any stage in its lifecycle, revert it to any version, or restore it after it