public
Fork of rails/rails
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/JackDanger/rails.git
Update XML documentation examples to include explicit type attributes. 
Closes #9754 [hasmanyjosh]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8090 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Marcel Molina (author)
Tue Nov 06 10:33:45 -0800 2007
commit  7863c4a18a4991c4942f52a4f88bbc1bdd9b7572
tree    02e8f16c49c162a0563f4cd9421ceed2bf02f107
parent  026973f6a06f97b265eb61baa299d3a8f3f737f6
...
 
 
1
2
3
...
1
2
3
4
5
0
@@ -1,3 +1,5 @@
0
+* Update XML documentation examples to include explicit type attributes. Closes #9754 [hasmanyjosh]
0
+
0
 *2.0.0 [Preview Release]* (September 29th, 2007)
0
 
0
 * Added one-off declarations of mock behavior [DHH]. Example:
...
60
61
62
63
 
64
65
66
...
88
89
90
91
92
93
 
 
 
94
95
96
...
60
61
62
 
63
64
65
66
...
88
89
90
 
 
 
91
92
93
94
95
96
0
@@ -60,7 +60,7 @@ for a request for a single element - the XML of that item is expected in respons
0
 
0
    # Expects a response of
0
    #
0
- # <person><id>1</id><attribute1>value1</attribute1><attribute2>..</attribute2></person>
0
+ # <person><id type="integer">1</id><attribute1>value1</attribute1><attribute2>..</attribute2></person>
0
    #
0
    # for GET http://api.people.com:3000/people/1.xml
0
    #
0
@@ -88,9 +88,9 @@ Collections can also be requested in a similar fashion
0
 
0
    # Expects a response of
0
    #
0
- # <people>
0
- # <person><id>1</id><first>Ryan</first></person>
0
- # <person><id>2</id><first>Jim</first></person>
0
+ # <people type="array">
0
+ # <person><id type="integer">1</id><first>Ryan</first></person>
0
+ # <person><id type="integer">2</id><first>Jim</first></person>
0
    # </people>
0
    #
0
    # for GET http://api.people.com:3000/people.xml
...
14
15
16
17
18
19
 
 
 
20
21
22
...
26
27
28
29
30
31
32
33
 
 
 
 
 
34
35
36
 
 
37
38
39
 
 
40
41
 
42
43
44
...
48
49
50
51
 
52
53
54
 
55
56
57
...
61
62
63
64
65
66
67
68
69
70
 
 
 
 
 
 
 
71
72
73
...
137
138
139
140
 
141
142
143
...
14
15
16
 
 
 
17
18
19
20
21
22
...
26
27
28
 
 
 
 
 
29
30
31
32
33
34
 
 
35
36
37
 
 
38
39
40
 
41
42
43
44
...
48
49
50
 
51
52
53
 
54
55
56
57
...
61
62
63
 
 
 
 
 
 
 
64
65
66
67
68
69
70
71
72
73
...
137
138
139
 
140
141
142
143
0
@@ -14,9 +14,9 @@ module ActiveResource
0
   # Person maps to the resources people, very similarly to Active Record) and a +site+ value, which holds the
0
   # URI of the resources.
0
   #
0
- # class Person < ActiveResource::Base
0
- # self.site = "http://api.people.com:3000/"
0
- # end
0
+ # class Person < ActiveResource::Base
0
+ # self.site = "http://api.people.com:3000/"
0
+ # end
0
   #
0
   # Now the Person class is mapped to RESTful resources located at <tt>http://api.people.com:3000/people/</tt>, and
0
   # you can now use Active Resource's lifecycles methods to manipulate resources.
0
@@ -26,19 +26,19 @@ module ActiveResource
0
   # Active Resource exposes methods for creating, finding, updating, and deleting resources
0
   # from REST web services.
0
   #
0
- # ryan = Person.new(:first => 'Ryan', :last => 'Daigle')
0
- # ryan.save #=> true
0
- # ryan.id #=> 2
0
- # Person.exists?(ryan.id) #=> true
0
- # ryan.exists? #=> true
0
+ # ryan = Person.new(:first => 'Ryan', :last => 'Daigle')
0
+ # ryan.save #=> true
0
+ # ryan.id #=> 2
0
+ # Person.exists?(ryan.id) #=> true
0
+ # ryan.exists? #=> true
0
   #
0
- # ryan = Person.find(1)
0
- # # => Resource holding our newly create Person object
0
+ # ryan = Person.find(1)
0
+ # # => Resource holding our newly create Person object
0
   #
0
- # ryan.first = 'Rizzle'
0
- # ryan.save #=> true
0
+ # ryan.first = 'Rizzle'
0
+ # ryan.save #=> true
0
   #
0
- # ryan.destroy #=> true
0
+ # ryan.destroy #=> true
0
   #
0
   # As you can see, these are very similar to Active Record's lifecycle methods for database records.
0
   # You can read more about each of these methods in their respective documentation.
0
@@ -48,10 +48,10 @@ module ActiveResource
0
   # Since simple CRUD/lifecycle methods can't accomplish every task, Active Resource also supports
0
   # defining your own custom REST methods.
0
   #
0
- # Person.new(:name => 'Ryan).post(:register)
0
+ # Person.new(:name => 'Ryan).post(:register)
0
   # # => { :id => 1, :name => 'Ryan', :position => 'Clerk' }
0
   #
0
- # Person.find(1).put(:promote, :position => 'Manager')
0
+ # Person.find(1).put(:promote, :position => 'Manager')
0
   # # => { :id => 1, :name => 'Ryan', :position => 'Manager' }
0
   #
0
   # For more information on creating and using custom REST methods, see the
0
@@ -61,13 +61,13 @@ module ActiveResource
0
   #
0
   # You can validate resources client side by overriding validation methods in the base class.
0
   #
0
- # class Person < ActiveResource::Base
0
- # self.site = "http://api.people.com:3000/"
0
- # protected
0
- # def validate
0
- # errors.add("last", "has invalid characters") unless last =~ /[a-zA-Z]*/
0
- # end
0
- # end
0
+ # class Person < ActiveResource::Base
0
+ # self.site = "http://api.people.com:3000/"
0
+ # protected
0
+ # def validate
0
+ # errors.add("last", "has invalid characters") unless last =~ /[a-zA-Z]*/
0
+ # end
0
+ # end
0
   #
0
   # See the ActiveResource::Validations documentation for more information.
0
   #
0
@@ -137,7 +137,7 @@ module ActiveResource
0
   # # is requested with invalid values, the response is:
0
   # #
0
   # # Response (422):
0
- # # <errors><error>First cannot be empty</error></errors>
0
+ # # <errors type="array"><error>First cannot be empty</error></errors>
0
   # #
0
   #
0
   # ryan.errors.invalid?(:first) #=> true

Comments

    No one has commented yet.