acts_as_identifier 1.1.1 → 1.1.2
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 +5 -3
- data/lib/acts_as_identifier/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d0ef5e8642b9ffa1aaf5dfa6e73a6d3b76885d08c90c8d6b74799c650b9ad86
|
4
|
+
data.tar.gz: 6637b7954d14b63f122ba48ba168fcdd6c8963e85188336d113b3d9c94c34a54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53908ce8a218741b7a2466f77e99b6fb80ef22460d4d920f43585038d92913a573dc9142c42d3e227e93c8771d869d0467b4a80cdb33ed207e9c0dee18e32a2b
|
7
|
+
data.tar.gz: 21eb32be02eb86a40a84a00691800f48cb80831904afa6606ede41c1c985cb03cee67b134d083611b7b557ada0ea7697dcc3f5b0e1ab6674e15d08792b860197
|
data/lib/acts_as_identifier.rb
CHANGED
@@ -44,11 +44,13 @@ module ActsAsIdentifier
|
|
44
44
|
"#{prefix}#{send("#{attr}_encoder").encode(num)}"
|
45
45
|
end
|
46
46
|
|
47
|
-
|
48
|
-
if
|
49
|
-
|
47
|
+
define_method "update_#{attr}_before_commit" do
|
48
|
+
if previous_changes.key?(id_column.to_s) && !destroyed?
|
49
|
+
update_column attr, self.class.send("encode_#{attr}", send(id_column))
|
50
50
|
end
|
51
51
|
end
|
52
|
+
|
53
|
+
before_commit :"update_#{attr}_before_commit"
|
52
54
|
end
|
53
55
|
end
|
54
56
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_identifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- xiaohui
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xencoder
|
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
requirements: []
|
85
|
-
rubygems_version: 3.0.
|
85
|
+
rubygems_version: 3.0.9
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: Auto-generate unique identifier value for Active Record
|