better_record 0.19.10 → 0.20.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 565899148bf26aa0a6bcc5a859a8ad7bddd663236795d912b86500f1dd23c098
4
- data.tar.gz: 646c14fb0e1b3223438c6f9544de291ae1112e01b358212bc8ffc1ff25455892
3
+ metadata.gz: 5ca398ddfa56296c0537b21aa7c83b003a74c507c59dcc1485746c9779f86102
4
+ data.tar.gz: f74f6161b0289e13d2c3782da0c76f97dd3d133196d5d3f32d077dac303ac8af
5
5
  SHA512:
6
- metadata.gz: 8bbda81459dbbb205d48c18120fd9322d0bee1ae3add696bad443c37bcfb5f95190605527dd203542ab6a4d4b50f3e416a2b260fdd4e9e230f98ab0d9d1d76bf
7
- data.tar.gz: e90f178d07d262529cfe54dae781e7bb1de5d22cf7addda16f2ad7619e472cb4cba57e442ccf9341d2701db401718a6ed46d16035bdb308049e2338a02f3fd0c
6
+ metadata.gz: d3c8c042446cbd69db0e8bb546db34d813877141eb33159ad0db07304875ec48579848ad5fd32c829a6406c0c58014740c47987b76937a61785c0f43865b680f
7
+ data.tar.gz: 77eee27b978463e0a80fee412c1ac2d2bca757fdab7c33c9fbcaa14d8de90b1a9f75da8af0873462e8f58a26047ad04a43ddb624ce9a44a42499ddd1d0a5398d
@@ -21,12 +21,19 @@ module BetterRecord
21
21
  type: blob.content_type
22
22
  )
23
23
 
24
- record.
25
- __send__ :delete_attachment, name, true
24
+ begin
25
+ record.
26
+ __send__ :delete_attachment, name, true
26
27
 
27
- record.
28
- reload.__send__(params[:attachment]).
29
- reload.attach(attachment)
28
+ record.
29
+ reload.
30
+ __send__(name).
31
+ attach(attachment)
32
+ rescue
33
+ puts "Attachment No Longer Exists"
34
+ puts $!.message
35
+ puts $!.backtrace
36
+ end
30
37
 
31
38
  puts "\n\nSAVED IMAGE\n\n"
32
39
  begin
@@ -173,11 +173,11 @@ module BetterRecord
173
173
  atchd = __send__ att_name
174
174
  if atchd.attached?
175
175
  begin
176
- atch = ActiveStorage::Attachment.find_by(atchd.id)
176
+ atch = ActiveStorage::Attachment.find_by(id: atchd.id)
177
177
  atch&.__send__ now ? :purge : :purge_later
178
178
  rescue Exception
179
179
  begin
180
- ActiveStorage::Attachment.find_by(atchd.id).destroy
180
+ ActiveStorage::Attachment.find_by(id: atchd.id).destroy
181
181
  rescue Exception
182
182
  end
183
183
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BetterRecord
4
- VERSION = '0.19.10'
4
+ VERSION = '0.20.2'
5
5
  end
metadata CHANGED
@@ -1,35 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: better_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.10
4
+ version: 0.20.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sampson Crowley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-07 00:00:00.000000000 Z
11
+ date: 2019-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: 5.2.0
20
17
  - - "~>"
21
18
  - !ruby/object:Gem::Version
22
- version: '5.2'
19
+ version: '5'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 5.2.2.1
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: 5.2.0
30
27
  - - "~>"
31
28
  - !ruby/object:Gem::Version
32
- version: '5.2'
29
+ version: '5'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 5.2.2.1
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: pg
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -351,7 +351,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
351
351
  - !ruby/object:Gem::Version
352
352
  version: '0'
353
353
  requirements: []
354
- rubygems_version: 3.0.2
354
+ rubygems_version: 3.0.3
355
355
  signing_key:
356
356
  specification_version: 4
357
357
  summary: Fix functions that are lacking in Active record to be compatible with multi-app