active_record_store 0.0.3 → 0.0.4

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: 58939c98f8357f0e0631adcb42f6f3536345933a
4
- data.tar.gz: ce391b16e9757a0213949abb3514a587cdece44f
3
+ metadata.gz: 788cd7f78ac5e062907fb7dc699def303cb293b7
4
+ data.tar.gz: d098b1e88168b8fe55f84c23bfad96b6b5021c70
5
5
  SHA512:
6
- metadata.gz: fcf68dc10366129f9d27eb1d860745a3db590a33e28c9ac5e68e84fe21ebfea70827a44f6916f29336ade05c65581d5034b8c44ee38a6306a7586913c0c3d8db
7
- data.tar.gz: 29b16f28accb242a110aefb9c83652595116b334eac9da42cb63be9f6243808b993a8c683295a21ee91d49157d3829adb2ef9c19806ccb42f20bfc065f2fcb13
6
+ metadata.gz: 564ade1c92a2eb420d5b98dec76ae16fceb3115bcc1d1f8d31d808da574f6dba69fa12f975e0b765739d8be300b556c12660411d8ed74014d34d17d0f793734f
7
+ data.tar.gz: ba76245525655aff127aac4a20cec466db418735e8680a2095aeaf66672a3b3dc738c461283ba3ca95d22dbdd670248ca13f30d2ab859959de79556a6682e2cf
@@ -30,14 +30,14 @@ class ArStore < ActiveRecord::Base
30
30
  options.symbolize_keys!
31
31
  raise ArgumentError "expires_in is the only valid option" if invalid_options(options).present?
32
32
  raise ArgumentError, "Pass value or a block, not both" if value && block_given?
33
- (get(key) || new).write!(key, (value || yield), options[:expires_in])
33
+ (get(key) || new).write!(key, (value.nil? ? yield : value), options[:expires_in])
34
34
  end
35
35
 
36
36
  def self.fetch(key, value = nil, options = {}, &blk)
37
37
  options.symbolize_keys!
38
38
  raise ArgumentError "expires_in is the only valid option" if invalid_options(options).present?
39
39
  raise ArgumentError, "Pass value or a block, not both" if value && block_given?
40
- read(key) || new.write!(key, (value || yield), options[:expires_in])
40
+ read(key) || new.write!(key, (value.nil? ? yield : value), options[:expires_in])
41
41
  end
42
42
 
43
43
  def self.clean
@@ -1,3 +1,3 @@
1
1
  module ActiveRecordStore
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Sharpe