attr_encrypted 4.1.0 → 4.1.1

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: 5a992ab4061d1d05c6de0891accee520006d545d727be49bd80c09ea4d55b44a
4
- data.tar.gz: c6dcfb039445ce7128e0c610d5ca6a4efce02ed195fe754fbc947a99f7b8cef7
3
+ metadata.gz: 8c21421f2067b7534cedb1a861331873c4b3de6b578d9f0afa0579d7fb734cfa
4
+ data.tar.gz: 73d1180d07c224bc7b8a7d80691cde48a07eb6d9fd009d7d5a41974b6bde02e5
5
5
  SHA512:
6
- metadata.gz: 62299d9d34f907ef99464ca41c5de51f9b05d440b2210ba377e05ac4fe02978fa58893cdb0ce002cd25216dace37c5f67b8a8c97ef76259066ee6fc57b93fd08
7
- data.tar.gz: f081aaebe945a24d2aff5fea11e671b700b8bf5a6513d36252c96f38e5134448efb9660d0fb6843418d926dcb3821ae1e9c23d2f2551ff2a0b261a678a6bb8f5
6
+ metadata.gz: 559cccac0a575b7c7834a0464c7ab218549e59cecc1c43d3ba6d7177994d18759d76b04e5a574d45a22ef0d57cb24f3881242282cb6ce3425b462d48cf48b3be
7
+ data.tar.gz: '09933cf933635867a06243b779ab46673266372a6b314f70a09faddac7aa75cb501b52510beb1f06f87a6a2ad104ff023e2d9b0b93a1c4f71e8888ab0b4a7dcc'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # attr_encrypted
2
2
 
3
+ ## 4.1.1
4
+
5
+ * Fixed: Fix SystemStackError when extending the reload method with Module#prepend.
6
+
3
7
  ## 4.1.0
4
8
 
5
9
  * Changed: Dropped support for `datamapper` which has not had a release since October 2011. This is in an attempt to make
@@ -6,19 +6,18 @@ if defined?(ActiveRecord::Base)
6
6
  module ActiveRecord
7
7
  RAILS_VERSION = Gem::Version.new(::ActiveRecord::VERSION::STRING).freeze
8
8
 
9
- def self.extended(base) # :nodoc:
10
- base.class_eval do
11
-
12
- # https://github.com/attr-encrypted/attr_encrypted/issues/68
13
- alias_method :reload_without_attr_encrypted, :reload
14
- def reload(*args, &block)
15
- result = reload_without_attr_encrypted(*args, &block)
16
- self.class.attr_encrypted_encrypted_attributes.keys.each do |attribute_name|
17
- instance_variable_set("@#{attribute_name}", nil)
18
- end
19
- result
9
+ module Reload
10
+ def reload(...)
11
+ result = super
12
+ self.class.attr_encrypted_encrypted_attributes.keys.each do |attribute_name|
13
+ instance_variable_set("@#{attribute_name}", nil)
20
14
  end
15
+ result
16
+ end
17
+ end
21
18
 
19
+ def self.extended(base) # :nodoc:
20
+ base.class_eval do
22
21
  attr_encrypted_options[:encode] = true
23
22
 
24
23
  class << self
@@ -148,5 +147,6 @@ if defined?(ActiveRecord::Base)
148
147
  ActiveSupport.on_load(:active_record) do
149
148
  extend AttrEncrypted
150
149
  extend AttrEncrypted::Adapters::ActiveRecord
150
+ prepend AttrEncrypted::Adapters::ActiveRecord::Reload
151
151
  end
152
152
  end
@@ -5,7 +5,7 @@ module AttrEncrypted
5
5
  module Version
6
6
  MAJOR = 4
7
7
  MINOR = 1
8
- PATCH = 0
8
+ PATCH = 1
9
9
 
10
10
  # Returns a version string by joining <tt>MAJOR</tt>, <tt>MINOR</tt>, and <tt>PATCH</tt> with <tt>'.'</tt>
11
11
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attr_encrypted
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 4.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Huber
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2024-05-30 00:00:00.000000000 Z
16
+ date: 2024-09-20 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: encryptor