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 CHANGED
@@ -27,7 +27,7 @@ begin
27
27
  require 'jeweler'
28
28
  Jeweler::Tasks.new do |s|
29
29
  s.name = "eyeballs"
30
- s.version = "0.5.13.1"
30
+ s.version = "0.5.13.2"
31
31
  s.author = "Paul Campbell"
32
32
  s.email = "paul@rslw.com"
33
33
  s.homepage = "http://www.github.com/paulca/eyeballs.js"
data/app.rb CHANGED
@@ -47,6 +47,10 @@ post '/test_id' do
47
47
  end
48
48
  end
49
49
 
50
+ get '/rails_reviews' do
51
+ '[{"rails_review": {"id":"1", "title": "Did you include the root?"}}]'
52
+ end
53
+
50
54
  post '/rails_reviews' do
51
55
  if params[:rails_review]
52
56
  '{"rails_review": {"id":"1"}}'
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{eyeballs}
8
- s.version = "0.5.13.1"
8
+ s.version = "0.5.13.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Paul Campbell"]
@@ -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);
@@ -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: 81
4
+ hash: 87
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
9
  - 13
10
- - 1
11
- version: 0.5.13.1
10
+ - 2
11
+ version: 0.5.13.2
12
12
  platform: ruby
13
13
  authors:
14
14
  - Paul Campbell