kono_utils 1.1.2 → 1.1.3

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: 69e15643bd9d8508138f9934fa1cbc9ab334008f55f143c13ac7dcb08191f82f
4
- data.tar.gz: e161ae70b8e3c6000a9d7c8e443a801aea5d37f3df5bf2f4bb6a0923082705d1
3
+ metadata.gz: 2ee1d8ef6cecb19fd0fd47b24502e172675f7f35a6b74899a78ea4499b36169f
4
+ data.tar.gz: e1dbdc2f86b29b1bccdc17cf209e1eb76b55b41d238b946c1f8165dc5239ef2b
5
5
  SHA512:
6
- metadata.gz: 6b04eb0bef475dcc2f4852429d5201d0cf496e8f64f5de180c975964f9c011ea5519e82f8693bd0c96abf9e4ff80ab78b786586a14b42b80e7a3c54554c1be7c
7
- data.tar.gz: 0354353de6c025075200f99f2f61f7ac1edceaea4d06ca47407a3c4eaa1f58eb5267893c7a5d3547989d0d901a2399afce651dd43e61b74168d5cc4ab982897c
6
+ metadata.gz: c313f3971a58eb2d98093ea758d735a4c4068c56994764b64ab00960ba5d3d30c33490a043dc4f9042e761b7bcb1942008d86ebb2d1155d5f584ca9f88c0cf75
7
+ data.tar.gz: 93769f645df6c1ee2c0a6ce1152c9fbf8b867786f63cbec5989d2ec2e87d2989137e37286cfb08ea1b4faba91ca6e0e7c5ad49f1814b1cb4b992512bd0e755c1
@@ -1,6 +1,5 @@
1
1
  require 'active_support/concern'
2
2
 
3
-
4
3
  module KonoUtils::Concerns
5
4
  ##
6
5
  # Includendo questo modulo nell'application record, possiamo andare injettare metodi necessari per la gestione
@@ -38,11 +37,13 @@ module KonoUtils::Concerns
38
37
  callback = "make_#{attr}".to_sym
39
38
  attr_accessor attr
40
39
 
41
- after_save callback, if: attr
40
+ after_save callback
42
41
 
43
42
  define_method(callback) do
44
- if self.send(field_name.to_sym).attached?
45
- self.send(field_name.to_sym).purge_later
43
+ if self.send(attr.to_sym) == '1'
44
+ if self.send(field_name.to_sym).attached?
45
+ self.send(field_name.to_sym).purge_later
46
+ end
46
47
  end
47
48
  end
48
49
 
@@ -1,3 +1,3 @@
1
1
  module KonoUtils
2
- VERSION = '1.1.2'
2
+ VERSION = '1.1.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kono_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marino
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-10 00:00:00.000000000 Z
11
+ date: 2021-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview