attr_encrypted 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7818979e143dc8810acdc45dfe6ae67273be455d
4
- data.tar.gz: 734c97e4b7d4109b40f4f6bdf7c34aace6e3be3b
3
+ metadata.gz: ac79c02884af5b1ee935a1f50d238f17d72346ff
4
+ data.tar.gz: cfdf773acde0d0b7c752f972064237395ba57071
5
5
  SHA512:
6
- metadata.gz: 6d8458d63ccd20fbeb9ae4d79689e0a90d3007bd0a212c428c9b95b44d20f39c5e038215bac1e5c7af1138f2517faf7a96973167b213be289a6b5fc7c1b75918
7
- data.tar.gz: 57201322d4c3dcbf30bf5c74f931b47bf6478626e925620497fc842d87c393aeb507d277c92f524ff233d515acafad1d367ecb3427250ace7d125a9e3ecb1ab8
6
+ metadata.gz: 42303b9fe3e46f0ce59c52a6cdcbaf73a3f8b6457f30ab7cbc62c765e9decb2c6b6559fc36135ff81867f5497c7952a1f84d14b1ef70020226dac12bc0f4d68e
7
+ data.tar.gz: 183ebc248cb0af6a621aa7edd471532634437a6367cc503810cd9409a94a04b60d6c7a186945bb533a3bf16f1e88c39f0e01c3da5e8afd00f95e5ea961b346d1
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # attr_encrypted #
2
2
 
3
+ ## 3.0.1 ##
4
+ * Fixed: attr_was method no longer calls undefined methods. (@saghaulor)
5
+
3
6
  ## 3.0.0 ##
4
7
  * Changed: Updated gemspec to use Encryptor v3.0.0. (@saghaulor)
5
8
  * Changed: Updated README with instructions related to moving from v2.0.0 to v3.0.0. (@saghaulor)
@@ -0,0 +1 @@
1
+ 845fc3cb09a19c3ac76192aba443788f92c880744617bca99b16fd31ce843e07
@@ -0,0 +1 @@
1
+ 81a065442258cc3702aab62c7b2307a48ed3e0deb803600d11a7480cce0db7c43fd9929acd2755081042f8989236553fd694b6cb62776bbfc53f9165a22cbca1
@@ -59,8 +59,10 @@ if defined?(ActiveRecord::Base)
59
59
  end
60
60
 
61
61
  define_method("#{attr}_was") do
62
- iv_and_salt = { iv: send("#{options[:attribute]}_iv_was"), salt: send("#{options[:attribute]}_salt_was"), operation: :decrypting }
63
- encrypted_attributes[attr].merge!(iv_and_salt)
62
+ attr_was_options = { operation: :decrypting }
63
+ attr_was_options[:iv]= send("#{options[:attribute]}_iv_was") if respond_to?("#{options[:attribute]}_iv_was")
64
+ attr_was_options[:salt]= send("#{options[:attribute]}_salt_was") if respond_to?("#{options[:attribute]}_salt_was")
65
+ encrypted_attributes[attr].merge!(attr_was_options)
64
66
  evaluated_options = evaluated_attr_encrypted_options_for(attr)
65
67
  [:iv, :salt, :operation].each { |key| encrypted_attributes[attr].delete(key) }
66
68
  self.class.decrypt(attr, send("#{options[:attribute]}_was"), evaluated_options)
@@ -3,7 +3,7 @@ module AttrEncrypted
3
3
  module Version
4
4
  MAJOR = 3
5
5
  MINOR = 0
6
- PATCH = 0
6
+ PATCH = 1
7
7
 
8
8
  # Returns a version string by joining <tt>MAJOR</tt>, <tt>MINOR</tt>, and <tt>PATCH</tt> with <tt>'.'</tt>
9
9
  #
@@ -192,6 +192,12 @@ class ActiveRecordTest < Minitest::Test
192
192
  assert_equal original_email, person.email_was
193
193
  person.email = 'test2@example.com'
194
194
  assert_equal original_email, person.email_was
195
+ old_pm_name = "Winston Churchill"
196
+ pm = PrimeMinister.create!(name: old_pm_name)
197
+ assert_equal old_pm_name, pm.name_was
198
+ old_zipcode = "90210"
199
+ address = Address.create!(zipcode: old_zipcode, mode: "single_iv_and_salt")
200
+ assert_equal old_zipcode, address.zipcode_was
195
201
  end
196
202
 
197
203
  if ::ActiveRecord::VERSION::STRING > "4.0"
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: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Huber
@@ -33,7 +33,7 @@ cert_chain:
33
33
  ZjeLmnSDiwL6doiP5IiwALH/dcHU67ck3NGf6XyqNwQrrmtPY0mv1WVVL4Uh+vYE
34
34
  kHoFzE2no0BfBg78Re8fY69P5yES5ncC
35
35
  -----END CERTIFICATE-----
36
- date: 2016-03-29 00:00:00.000000000 Z
36
+ date: 2016-04-02 00:00:00.000000000 Z
37
37
  dependencies:
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: encryptor
@@ -222,6 +222,8 @@ files:
222
222
  - Rakefile
223
223
  - attr_encrypted.gemspec
224
224
  - certs/saghaulor.pem
225
+ - checksum/attr_encrypted-3.0.0.gem.sha256
226
+ - checksum/attr_encrypted-3.0.0.gem.sha512
225
227
  - lib/attr_encrypted.rb
226
228
  - lib/attr_encrypted/adapters/active_record.rb
227
229
  - lib/attr_encrypted/adapters/data_mapper.rb
metadata.gz.sig CHANGED
Binary file