activeresource 3.1.0 → 3.1.1.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activeresource might be problematic. Click here for more details.
- data/CHANGELOG +6 -1
- data/lib/active_resource/base.rb +9 -1
- data/lib/active_resource/version.rb +2 -2
- metadata +23 -16
data/CHANGELOG
CHANGED
@@ -1,4 +1,9 @@
|
|
1
|
-
*Rails 3.1.
|
1
|
+
*Rails 3.1.1 (unreleased)*
|
2
|
+
|
3
|
+
* No changes
|
4
|
+
|
5
|
+
|
6
|
+
*Rails 3.1.0 (August 30, 2011)*
|
2
7
|
|
3
8
|
* The default format has been changed to JSON for all requests. If you want to continue to use XML you will need to set `self.format = :xml` in the class. eg.
|
4
9
|
|
data/lib/active_resource/base.rb
CHANGED
@@ -1357,7 +1357,9 @@ module ActiveResource
|
|
1357
1357
|
end
|
1358
1358
|
|
1359
1359
|
def load_attributes_from_response(response)
|
1360
|
-
if
|
1360
|
+
if (response_code_allows_body?(response.code) &&
|
1361
|
+
(response['Content-Length'].nil? || response['Content-Length'] != "0") &&
|
1362
|
+
!response.body.nil? && response.body.strip.size > 0)
|
1361
1363
|
load(self.class.format.decode(response.body), true)
|
1362
1364
|
@persisted = true
|
1363
1365
|
end
|
@@ -1381,6 +1383,12 @@ module ActiveResource
|
|
1381
1383
|
end
|
1382
1384
|
|
1383
1385
|
private
|
1386
|
+
|
1387
|
+
# Determine whether the response is allowed to have a body per HTTP 1.1 spec section 4.4.1
|
1388
|
+
def response_code_allows_body?(c)
|
1389
|
+
!((100..199).include?(c) || [204,304].include?(c))
|
1390
|
+
end
|
1391
|
+
|
1384
1392
|
# Tries to find a resource for a given collection name; if it fails, then the resource is created
|
1385
1393
|
def find_or_create_resource_for_collection(name)
|
1386
1394
|
find_or_create_resource_for(ActiveSupport::Inflector.singularize(name.to_s))
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeresource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 977940594
|
5
|
+
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
|
9
|
+
- 1
|
10
|
+
- rc1
|
11
|
+
version: 3.1.1.rc1
|
11
12
|
platform: ruby
|
12
13
|
authors:
|
13
14
|
- David Heinemeier Hansson
|
@@ -15,7 +16,8 @@ autorequire:
|
|
15
16
|
bindir: bin
|
16
17
|
cert_chain: []
|
17
18
|
|
18
|
-
date: 2011-
|
19
|
+
date: 2011-09-14 00:00:00 -07:00
|
20
|
+
default_executable:
|
19
21
|
dependencies:
|
20
22
|
- !ruby/object:Gem::Dependency
|
21
23
|
name: activesupport
|
@@ -25,12 +27,13 @@ dependencies:
|
|
25
27
|
requirements:
|
26
28
|
- - "="
|
27
29
|
- !ruby/object:Gem::Version
|
28
|
-
hash:
|
30
|
+
hash: 977940594
|
29
31
|
segments:
|
30
32
|
- 3
|
31
33
|
- 1
|
32
|
-
-
|
33
|
-
|
34
|
+
- 1
|
35
|
+
- rc1
|
36
|
+
version: 3.1.1.rc1
|
34
37
|
type: :runtime
|
35
38
|
version_requirements: *id001
|
36
39
|
- !ruby/object:Gem::Dependency
|
@@ -41,12 +44,13 @@ dependencies:
|
|
41
44
|
requirements:
|
42
45
|
- - "="
|
43
46
|
- !ruby/object:Gem::Version
|
44
|
-
hash:
|
47
|
+
hash: 977940594
|
45
48
|
segments:
|
46
49
|
- 3
|
47
50
|
- 1
|
48
|
-
-
|
49
|
-
|
51
|
+
- 1
|
52
|
+
- rc1
|
53
|
+
version: 3.1.1.rc1
|
50
54
|
type: :runtime
|
51
55
|
version_requirements: *id002
|
52
56
|
description: REST on Rails. Wrap your RESTful web app with Ruby classes and work with them like Active Record models.
|
@@ -76,6 +80,7 @@ files:
|
|
76
80
|
- lib/active_resource/validations.rb
|
77
81
|
- lib/active_resource/version.rb
|
78
82
|
- lib/active_resource.rb
|
83
|
+
has_rdoc: true
|
79
84
|
homepage: http://www.rubyonrails.org
|
80
85
|
licenses: []
|
81
86
|
|
@@ -99,16 +104,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
99
104
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
105
|
none: false
|
101
106
|
requirements:
|
102
|
-
- - "
|
107
|
+
- - ">"
|
103
108
|
- !ruby/object:Gem::Version
|
104
|
-
hash:
|
109
|
+
hash: 25
|
105
110
|
segments:
|
106
|
-
-
|
107
|
-
|
111
|
+
- 1
|
112
|
+
- 3
|
113
|
+
- 1
|
114
|
+
version: 1.3.1
|
108
115
|
requirements: []
|
109
116
|
|
110
117
|
rubyforge_project:
|
111
|
-
rubygems_version: 1.
|
118
|
+
rubygems_version: 1.3.7
|
112
119
|
signing_key:
|
113
120
|
specification_version: 3
|
114
121
|
summary: REST modeling framework (part of Rails).
|