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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d0ef5e8642b9ffa1aaf5dfa6e73a6d3b76885d08c90c8d6b74799c650b9ad86
4
- data.tar.gz: 6637b7954d14b63f122ba48ba168fcdd6c8963e85188336d113b3d9c94c34a54
3
+ metadata.gz: 5949d5438578e6ba0dc781e97099ff60de4929de294a46dcb64a1b8f558fd805
4
+ data.tar.gz: e3975e906f51cc8ff890ea819658d70cf6b97b35c0748639c61acd440fbd3d97
5
5
  SHA512:
6
- metadata.gz: 53908ce8a218741b7a2466f77e99b6fb80ef22460d4d920f43585038d92913a573dc9142c42d3e227e93c8771d869d0467b4a80cdb33ed207e9c0dee18e32a2b
7
- data.tar.gz: 21eb32be02eb86a40a84a00691800f48cb80831904afa6606ede41c1c985cb03cee67b134d083611b7b557ada0ea7697dcc3f5b0e1ab6674e15d08792b860197
6
+ metadata.gz: 1652f9572cf96245f35ad3f36bda3f71ad8e1f271d316b213734c466e7898b772a09a5dd673c24f2a570a2d6342ca48a26766f337235ad19b39922fdb054d1bd
7
+ data.tar.gz: 7d12df48ab6b85d74b1fa345491fcd1b319bb8f7623701bfcdf5f0fa17abf300880d37c5a4576d9ef8605e793993f6cfb4b79824f3817a2223209d822e8015f0
@@ -44,13 +44,11 @@ module ActsAsIdentifier
44
44
  "#{prefix}#{send("#{attr}_encoder").encode(num)}"
45
45
  end
46
46
 
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
- 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 :"update_#{attr}_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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActsAsIdentifier
4
- VERSION = '1.1.2'
4
+ VERSION = '1.1.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_identifier
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
  - xiaohui