depository 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/depository/collection.rb +3 -7
- data/lib/depository/database.rb +4 -0
- data/lib/depository/result.rb +1 -1
- data/lib/depository/sequel.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Nzc3Y2Q3NzJmZDAxMjI4N2RmZmRlYjJlOGQ3NjVkZmZjNGE2ZjFjZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZmM5M2QxMGM3NTdlY2NiMDg4N2EzN2FjOTVhNmUxNjZlYTIyY2Q3OQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YWQ5MjZjYTdkMGZjYTk0MjY0MGMwOWFlOTBjMTVmNTIyOTg0ZmRjODIwNzky
|
10
|
+
YWI1ODBiMzk3MGNjYWJjMmNiNDQ3ODRjYjBhMDkxNDM1MjQ4NTVjOWU3MGIw
|
11
|
+
MTIyYjAzMjFiNzc4NGYxZmE3MDcwOTMwZGI4YTQ1NzM1ODg5MzM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjljZDc0MGI0OWJlMGUxM2U1MTJiYWY1MGMwZDkxYzE5NzExOWFkOTcyYWUz
|
14
|
+
NTU0MTdlODcwNWM1MmM0NTQ5ZGJiODA2ODc3NzdhZTljNmFjMTdlYTU5YWI3
|
15
|
+
MWMzZmYwOGVlYTc5MDE5MDM1ODIwMGE0ZWUyZDE2ZmQzOTNjZGM=
|
@@ -23,12 +23,12 @@ module Depository
|
|
23
23
|
self._model_class ||= _model_block.call
|
24
24
|
end
|
25
25
|
|
26
|
-
def use_db(
|
27
|
-
self._db_name =
|
26
|
+
def use_db(db)
|
27
|
+
db.is_a?(Symbol) ? self._db_name = db : @_db = Result.new(db, self)
|
28
28
|
end
|
29
29
|
|
30
30
|
def db
|
31
|
-
|
31
|
+
@_db ||= Result.new(Database[_db_name], self)
|
32
32
|
end
|
33
33
|
|
34
34
|
def primary_key
|
@@ -59,10 +59,6 @@ module Depository
|
|
59
59
|
db.where(primary_key => key).delete
|
60
60
|
end
|
61
61
|
|
62
|
-
def count
|
63
|
-
db.raw.size
|
64
|
-
end
|
65
|
-
|
66
62
|
def convert(attrs)
|
67
63
|
case attrs
|
68
64
|
when Array
|
data/lib/depository/database.rb
CHANGED
data/lib/depository/result.rb
CHANGED
data/lib/depository/sequel.rb
CHANGED
@@ -11,7 +11,7 @@ module Depository
|
|
11
11
|
:order_append, :order_prepend, :order_more, :reverse, :reverse_order,
|
12
12
|
:unordered, :limit, :offset, :unlimited, :union, :intersect, :except,
|
13
13
|
:for_update, :lock_style, :with, :with_recursive, :clone, :distinct,
|
14
|
-
:naked, :qualify, :server, :with_sql,
|
14
|
+
:naked, :qualify, :server, :with_sql, :count,
|
15
15
|
:insert, :update, :delete, :max, :min]
|
16
16
|
|
17
17
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: depository
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Pratt
|
@@ -101,7 +101,7 @@ files:
|
|
101
101
|
- lib/depository/model.rb
|
102
102
|
- lib/depository/result.rb
|
103
103
|
- lib/depository/sequel.rb
|
104
|
-
homepage:
|
104
|
+
homepage: https://github.com/pratt121/depository
|
105
105
|
licenses:
|
106
106
|
- WTFPL
|
107
107
|
metadata: {}
|