aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/CHANGELOG
blob: 43ab43c6cb5a3d578937720e5c9bf6533c103067 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
*SVN*

* Add basic logging support for logging outgoing requests. [Jamis Buck]

* Add Base.delete for deleting resources without having to instantiate them first. [Jamis Buck]

* Make #save behavior mimic AR::Base#save (true on success, false on failure). [Jamis Buck]

* Add Basic HTTP Authentication to ActiveResource (closes #6305). [jonathan]

* Extracted #id_from_response as an entry point for customizing how a created resource gets its own ID.
  By default, it extracts from the Location response header.

* Optimistic locking: raise ActiveResource::ResourceConflict on 409 Conflict response. [Jeremy Kemper]

    # Example controller action
    def update
      @person.save!
    rescue ActiveRecord::StaleObjectError
      render :xml => @person.reload.to_xml, :status => '409 Conflict'
    end

* Basic validation support [Rick Olson]

  Parses the xml response of ActiveRecord::Errors#to_xml with a similar interface to ActiveRecord::Errors.  
  
    render :xml => @person.errors.to_xml, :status => '400 Validation Error'

* Deep hashes are converted into collections of resources.  [Jeremy Kemper]
    Person.new :name => 'Bob',
               :address => { :id => 1, :city => 'Portland' },
               :contacts => [{ :id => 1 }, { :id => 2 }]
  Looks for Address and Contact resources and creates them if unavailable.
  So clients can fetch a complex resource in a single request if you e.g.
    render :xml => @person.to_xml(:include => [:address, :contacts])
  in your controller action.

* Major updates [Rick Olson]

  * Add full support for find/create/update/destroy
  * Add support for specifying prefixes.
  * Allow overriding of element_name, collection_name, and primary key
  * Provide simpler HTTP mock interface for testing
  
    # rails routing code
    map.resources :posts do |post|
      post.resources :comments
    end
    
    # ActiveResources
    class Post < ActiveResource::Base
      self.site = "http://37s.sunrise.i:3000/"
    end

    class Comment < ActiveResource::Base
      self.site = "http://37s.sunrise.i:3000/posts/:post_id/"
    end
    
    @post     = Post.find 5
    @comments = Comment.find :all, :post_id => @post.id

    @comment  = Comment.new({:body => 'hello world'}, {:post_id => @post.id})
    @comment.save

* Base.site= accepts URIs. 200...400 are valid response codes. PUT and POST request bodies default to ''. [Jeremy Kemper]

* Initial checkin: object-oriented client for restful HTTP resources which follow the Rails convention. [DHH]