eyeballs 0.5.13.1 → 0.5.13.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/app.rb +4 -0
- data/eyeballs.gemspec +1 -1
- data/src/drivers/jquery/adapters/o_O.rest.js +10 -0
- data/test/unit/test_rest.html +9 -1
- metadata +3 -3
data/Rakefile
CHANGED
data/app.rb
CHANGED
data/eyeballs.gemspec
CHANGED
@@ -20,6 +20,7 @@ o_O.rest = {
|
|
20
20
|
}
|
21
21
|
},
|
22
22
|
all: function(model, callback, original_callback){
|
23
|
+
var include_json_root = this.include_json_root(model);
|
23
24
|
$.get(this.figure_url(original_callback, model), function(response){
|
24
25
|
var documents;
|
25
26
|
try {
|
@@ -29,6 +30,15 @@ o_O.rest = {
|
|
29
30
|
documents = response
|
30
31
|
}
|
31
32
|
|
33
|
+
if(include_json_root)
|
34
|
+
{
|
35
|
+
var out = [];
|
36
|
+
for(i=0; i<documents.length;i++)
|
37
|
+
{
|
38
|
+
documents[i] = documents[i][model.model_name.underscore()]
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
32
42
|
if(typeof callback === 'function')
|
33
43
|
{
|
34
44
|
callback(documents, response);
|
data/test/unit/test_rest.html
CHANGED
@@ -178,7 +178,7 @@
|
|
178
178
|
}})
|
179
179
|
})
|
180
180
|
|
181
|
-
asyncTest('getting all', 2, function(){
|
181
|
+
asyncTest('Review.all() getting all', 2, function(){
|
182
182
|
var review = Review.initialize({title: 'Local, baby'});
|
183
183
|
review.save(function(saved_review){
|
184
184
|
Review.all(function(documents){
|
@@ -189,6 +189,14 @@
|
|
189
189
|
});
|
190
190
|
})
|
191
191
|
|
192
|
+
asyncTest('RailsReview.all() getting all', 2, function(){
|
193
|
+
RailsReview.all(function(documents){
|
194
|
+
equals(documents[0].title, 'Did you include the root?', 'It should pull in everything')
|
195
|
+
equals(documents[0].id, '1', 'It should persist the id')
|
196
|
+
start();
|
197
|
+
});
|
198
|
+
})
|
199
|
+
|
192
200
|
asyncTest('getting all with content type', 2, function(){
|
193
201
|
var review = Review.initialize({title: 'Local, baby'});
|
194
202
|
review.save(function(saved_review){
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eyeballs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 87
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
9
|
- 13
|
10
|
-
-
|
11
|
-
version: 0.5.13.
|
10
|
+
- 2
|
11
|
+
version: 0.5.13.2
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Paul Campbell
|