document_file 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/document_file.rb +4 -2
- data/lib/document_file/version.rb +1 -1
- data/test/document_file_collection_test.rb +6 -0
- metadata +4 -16
data/lib/document_file.rb
CHANGED
@@ -64,8 +64,10 @@ private
|
|
64
64
|
module ClassMethods
|
65
65
|
@@documents = nil
|
66
66
|
|
67
|
-
def all
|
68
|
-
|
67
|
+
def all(options = {})
|
68
|
+
offset = options[:offset]
|
69
|
+
limit = options[:limit]
|
70
|
+
return @@documents.offset_and_limitize(offset, limit) if @@documents
|
69
71
|
reload!
|
70
72
|
end
|
71
73
|
|
@@ -213,5 +213,11 @@ describe DocumentFile::Collection do
|
|
213
213
|
assert_equal 1, document_files.size
|
214
214
|
assert_equal 2, document_files.total
|
215
215
|
end
|
216
|
+
|
217
|
+
it 'should work on the root collection' do
|
218
|
+
document_files = MyDocument.all :limit => 1
|
219
|
+
assert_equal 1, document_files.size
|
220
|
+
assert_equal 1, document_files.first.id
|
221
|
+
end
|
216
222
|
end
|
217
223
|
end
|
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: document_file
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 7
|
9
|
-
version: 0.0.7
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.8
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- Ralph von der Heyden
|
@@ -14,7 +10,7 @@ autorequire:
|
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date:
|
13
|
+
date: 2011-02-17 00:00:00 +01:00
|
18
14
|
default_executable:
|
19
15
|
dependencies:
|
20
16
|
- !ruby/object:Gem::Dependency
|
@@ -25,10 +21,6 @@ dependencies:
|
|
25
21
|
requirements:
|
26
22
|
- - ~>
|
27
23
|
- !ruby/object:Gem::Version
|
28
|
-
segments:
|
29
|
-
- 3
|
30
|
-
- 0
|
31
|
-
- 0
|
32
24
|
version: 3.0.0
|
33
25
|
type: :runtime
|
34
26
|
version_requirements: *id001
|
@@ -65,21 +57,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
65
57
|
requirements:
|
66
58
|
- - ">="
|
67
59
|
- !ruby/object:Gem::Version
|
68
|
-
segments:
|
69
|
-
- 0
|
70
60
|
version: "0"
|
71
61
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
62
|
none: false
|
73
63
|
requirements:
|
74
64
|
- - ">="
|
75
65
|
- !ruby/object:Gem::Version
|
76
|
-
segments:
|
77
|
-
- 0
|
78
66
|
version: "0"
|
79
67
|
requirements: []
|
80
68
|
|
81
69
|
rubyforge_project:
|
82
|
-
rubygems_version: 1.
|
70
|
+
rubygems_version: 1.5.2
|
83
71
|
signing_key:
|
84
72
|
specification_version: 3
|
85
73
|
summary: Document file is an object mapper for plain text documents.
|