tanoshimu_utils 1.2.1 → 1.2.2

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: ad2744dfa5a004ec4421effd619746f20838f9c20b71fb15c07fa1ca9b6534b4
4
- data.tar.gz: 6f74c6ef08e01bdff202f1cf082943e6c3a585267a31fad26e4b8db51c334c57
3
+ metadata.gz: 0d89a89ee2a88ac4a6c6ba96c98a4b158d29fbd71ec306c1b2934d09e7cdf495
4
+ data.tar.gz: d2eea7a91e7fefc67beb18d1947e9a213700d6ac168c9bcdff25596860d97646
5
5
  SHA512:
6
- metadata.gz: 22b5edcc55a59508622e3ad33437c2afd22b6d169051cb32d626f4655bc5fb2a9e04b026cd4ce8bb476dd950425a8bfcdaf54ac56fccc50171356c05982c217b
7
- data.tar.gz: a62f0c570689254ad93bd1c86672e2867b9e3c34ba2d5194610c2d445cfebafa7756c3a67baec3086ae5d0c66ca1a1a161c6200a8675a8b4b85d732b9bf939bb
6
+ metadata.gz: 05df987581a2076776af93969b5575ad5c379b895fbae54a5189b26944ea5c0ddc7f68ed5f4d20f15334533a494ab367143197da7020bd7d75ab21310623d62f
7
+ data.tar.gz: 4b4c0787f53d8577611e256d0caff4f37d1d802a220a6703dee1f7b51a1993c04f73b46413f55f29dfd292a5ae2c56d21a42f5e6048a18aaab6da1ba97a85f4b
@@ -33,6 +33,12 @@ module TanoshimuUtils
33
33
  send(:define_method, "#{resource_name}?") do
34
34
  (fetch!(resource_name, default_url)&.attached?).present?
35
35
  end
36
+ send(:define_method, "generate_#{resource_name}_url!") do
37
+ return true if send("#{resource_url}?") && !force
38
+
39
+ new_url = send("#{resource_url}!")
40
+ new_url.present? && update(resource_url => new_url)
41
+ end
36
42
  end
37
43
  end
38
44
 
@@ -1,3 +1,3 @@
1
1
  module TanoshimuUtils
2
- VERSION = '1.2.1'
2
+ VERSION = '1.2.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tanoshimu_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akinyele Cafe-Febrissy