persistent_hash 0.0.5 → 0.0.6

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
  SHA1:
3
- metadata.gz: 211716b2b7a773cd3d49744fa755aa256ec5c20f
4
- data.tar.gz: 112312b1e62a18226fb4149fcadfe5ed0956e027
3
+ metadata.gz: 06b320eea13bba423859587cff01a544d305ec19
4
+ data.tar.gz: 2c5a643b36f877b1aaa3ad210fee8c011a73f750
5
5
  SHA512:
6
- metadata.gz: 18f2d80b2e804253463f761bbb73f06fdcb8b37e209837f952d3fbca4f014b4952d74c8a9276a849660165e93cf4e139705008e1ae44dfc1c7095e9b5c89fdb3
7
- data.tar.gz: 9286dfda457d9c71a03f9f68a64bafaaa449c99399a46c3baebdae6c6455a5297aaf208e8cd1e029c66476aaa03308bde56cc0f0e80a6f2ab8d1b6e2f9c58c51
6
+ metadata.gz: 71cfed0122f4b6599e573004a3aa69fb167af398f75ce5f710dbe6ad96d2cd54f33f348de365397d533dc2da2183ddced1fa11665fb38743310bdbdf98d0f123
7
+ data.tar.gz: ad6f5667e8316b8d24ad130e8d5ba0010f927dce8b9c707fd98511fded7c5f3d9acf3443f70625ee110c0febfb4b247e797fd253a81880a963d5161210ae6cae
@@ -5,16 +5,18 @@ module PersistentHash
5
5
 
6
6
  # save a value in the hash
7
7
  def self.[]=(key_name, value)
8
- where(key_name: key_name).delete_all
8
+ transaction do
9
+ where(key_name: key_name).delete_all
9
10
 
10
- if ! value.nil?
11
- formatted = PersistentHash::Formatter.format(value)
11
+ if ! value.nil?
12
+ formatted = PersistentHash::Formatter.format(value)
12
13
 
13
- create!(
14
- key_name: key_name,
15
- readable_value: formatted,
16
- marshalled: Base64.encode64(Marshal.dump(value))
17
- )
14
+ create!(
15
+ key_name: key_name,
16
+ readable_value: formatted,
17
+ marshalled: Base64.encode64(Marshal.dump(value))
18
+ )
19
+ end
18
20
  end
19
21
  end
20
22
 
@@ -1,3 +1,3 @@
1
1
  module PersistentHash
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: persistent_hash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Dean
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-19 00:00:00.000000000 Z
11
+ date: 2017-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails