uorm 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,13 @@
1
+ module Uorm
2
+ module Redis
3
+ class DB
4
+ class << self
5
+ attr_accessor :nr
6
+
7
+ def client
8
+ @client ||= ::Redis.new driver: :synchrony, db: nr
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -5,7 +5,7 @@ module Uorm
5
5
 
6
6
  def initialize model
7
7
  @model = model
8
- @collection = ::Redis.new driver: :synchrony
8
+ @collection = DB.client
9
9
  end
10
10
 
11
11
  def new? object
data/lib/uorm/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Uorm
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
data/lib/uorm.rb CHANGED
@@ -15,6 +15,7 @@ module Uorm
15
15
  autoload :Redis, 'uorm/redis'
16
16
  module Redis
17
17
  autoload :Persistance, 'uorm/redis/persistance'
18
+ autoload :DB, 'uorm/redis/db'
18
19
  require 'multi_json'
19
20
  end
20
21
 
@@ -3,6 +3,8 @@ require 'spec_helper'
3
3
  require 'redis'
4
4
  require 'hiredis'
5
5
 
6
+ Uorm::Redis::DB.nr = 15 #last one for safety
7
+
6
8
  class ARedisModel
7
9
  include Uorm::DSL
8
10
  include Uorm::Attributes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uorm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -179,6 +179,7 @@ files:
179
179
  - lib/uorm/field.rb
180
180
  - lib/uorm/field_collection.rb
181
181
  - lib/uorm/redis.rb
182
+ - lib/uorm/redis/db.rb
182
183
  - lib/uorm/redis/persistance.rb
183
184
  - lib/uorm/type.rb
184
185
  - lib/uorm/version.rb