activesupport-db-cache 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,9 @@
1
+ require "base64"
1
2
 
2
3
  module ActiveSupport
3
4
  module Cache
4
5
  class ActiveRecordStore < Store
5
- VERSION = "0.0.1"
6
+ VERSION = "0.0.2"
6
7
 
7
8
  # set database url:
8
9
  # ENV['ACTIVE_RECORD_CACHE_STORE_DATABASE_URL'] = "sqlite3://./db/test2.sqlite3"
@@ -11,7 +12,7 @@ module ActiveSupport
11
12
  establish_connection ENV['ACTIVE_RECORD_CACHE_STORE_DATABASE_URL'] if ENV['ACTIVE_RECORD_CACHE_STORE_DATABASE_URL'].present?
12
13
 
13
14
  def value
14
- Marshal.load(self[:value])
15
+ Marshal.load(Base64.decode64(self[:value]))
15
16
  end
16
17
 
17
18
  def expired?
@@ -33,7 +34,7 @@ module ActiveSupport
33
34
 
34
35
  def write_entry(key, entry, options)
35
36
  item = CacheItem.find_or_initialize_by_key(key)
36
- item.value = Marshal.dump(entry.value)
37
+ item.value = Base64.encode64(Marshal.dump(entry.value))
37
38
  item.save
38
39
  end
39
40
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activesupport-db-cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-15 00:00:00.000000000 Z
12
+ date: 2013-01-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport