netzke-redis-persistence 0.0.5 → 0.0.6

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: 4630a7a11fb1d2268e48c7d57fd290a6e459a80e
4
- data.tar.gz: 09aff2e3ff19a7706f4de7cb2b2c11e7667adb9b
3
+ metadata.gz: 3722f08f036f1dcecb23abf07cafb71467147127
4
+ data.tar.gz: 8448e0ce617ded72dd7ad07c303e12b2fc0b34b7
5
5
  SHA512:
6
- metadata.gz: 9376a90b5125e037cc9a42ca60c02331e217cc09c22b408c04b1dbc03985da62df3e92676487132318ff7cc3d10f8742de0450891ff5eb7e96fcb92ee908ce1c
7
- data.tar.gz: a8737222d94b60f538bce485e4aacb59f2a6515fc859110a42474163ed1673d989415334bc47352455b7213d0a31714d1d0171507c052c076cc6075d5dbf2be5
6
+ metadata.gz: fddbf63c06b7c56e21d29f93ba2b2ee2c496cf71c875d0cc27f45b38dee2f67fa38950d7d9e864152e0ddb079acc22012eec1ffbebd497893668a6ba85db29ec
7
+ data.tar.gz: a2b05d7c3619875c68762f8f3791461fc055a5638e6578cc511b44f7de7a7377546aa8445499e5b6bd415140b429486e6cd731e56e7cecbfaacb8933a8522a99
@@ -1,10 +1,14 @@
1
1
 
2
2
  module NetzkeRedisPersistence
3
3
  class Configuration
4
- attr_accessor :redis_connection
4
+ attr_accessor :redis_connection, :scope
5
5
 
6
6
  def get_redis_connection
7
7
  @redis_connection ? @redis_connection.call : Redis.new
8
8
  end
9
+
10
+ def get_scope
11
+ @scope
12
+ end
9
13
  end
10
14
  end
@@ -19,7 +19,11 @@ Netzke::Core::State.module_eval do
19
19
  # * delete(key)
20
20
  # * clear
21
21
  def state
22
- key = [persistence_key]
22
+ key = []
23
+ if scope = NetzkeRedisPersistence.configuration.get_scope
24
+ key << scope
25
+ end
26
+ key << persistence_key
23
27
  if Netzke::Base.controller && Netzke::Base.controller.respond_to?(:current_user) && Netzke::Base.controller.current_user
24
28
  key << Netzke::Base.controller.current_user.id
25
29
  end
@@ -1,3 +1,3 @@
1
1
  module NetzkeRedisPersistence
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: netzke-redis-persistence
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
  - firemind
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-09 00:00:00.000000000 Z
11
+ date: 2017-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: netzke-core
@@ -83,5 +83,5 @@ signing_key:
83
83
  specification_version: 4
84
84
  summary: Gem to store netzke persistence values in redis store.
85
85
  test_files:
86
- - test/test_helper.rb
87
86
  - test/netzke-redis-persistence_test.rb
87
+ - test/test_helper.rb