acts_as_identifier 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 +4 -4
- data/lib/acts_as_identifier.rb +3 -5
- data/lib/acts_as_identifier/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5949d5438578e6ba0dc781e97099ff60de4929de294a46dcb64a1b8f558fd805
|
4
|
+
data.tar.gz: e3975e906f51cc8ff890ea819658d70cf6b97b35c0748639c61acd440fbd3d97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1652f9572cf96245f35ad3f36bda3f71ad8e1f271d316b213734c466e7898b772a09a5dd673c24f2a570a2d6342ca48a26766f337235ad19b39922fdb054d1bd
|
7
|
+
data.tar.gz: 7d12df48ab6b85d74b1fa345491fcd1b319bb8f7623701bfcdf5f0fa17abf300880d37c5a4576d9ef8605e793993f6cfb4b79824f3817a2223209d822e8015f0
|
data/lib/acts_as_identifier.rb
CHANGED
@@ -44,13 +44,11 @@ module ActsAsIdentifier
|
|
44
44
|
"#{prefix}#{send("#{attr}_encoder").encode(num)}"
|
45
45
|
end
|
46
46
|
|
47
|
-
define_method "
|
48
|
-
|
49
|
-
update_column attr, self.class.send("encode_#{attr}", send(id_column))
|
50
|
-
end
|
47
|
+
define_method "acts_as_identifier__update_#{attr}" do
|
48
|
+
update_column attr, self.class.send("encode_#{attr}", send(id_column))
|
51
49
|
end
|
52
50
|
|
53
|
-
before_commit :"
|
51
|
+
before_commit :"acts_as_identifier__update_#{attr}", if: -> { previous_changes.key?(id_column.to_s) && !destroyed? }
|
54
52
|
end
|
55
53
|
end
|
56
54
|
end
|