orm_adapter_activeresource 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,16 @@
1
+ # system crap
2
+ .DS_Store
3
+
4
+ # local ruby/gems dev stuff
5
+ .rvmrc
6
+ .bundle
7
+ Gemfile.lock
8
+ spec/orm_adapter/adapters/active_resource_server/server.log
9
+
10
+ # built docs
11
+ .yardoc
12
+ doc
13
+
14
+ # built gems
15
+ pkg
16
+ *.gem
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ # Used for testing ActiveResource integration
6
+ gem 'rails', '3.0.12'
7
+ gem 'sqlite3'
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'rspec/core/rake_task'
4
+ $:.push File.expand_path("../lib", __FILE__)
5
+
6
+ task :default => :spec
7
+
8
+ RSpec::Core::RakeTask.new(:spec)
@@ -0,0 +1,78 @@
1
+ require 'active_resource'
2
+
3
+ module OrmAdapter
4
+ class ActiveResource < Base
5
+ # Do not consider these to be part of the class list
6
+ def self.except_classes
7
+ @@except_classes ||= []
8
+ end
9
+
10
+ # Gets a list of the available models for this adapter
11
+ def self.model_classes
12
+ begin
13
+ klasses = ::ActiveResource::Base.__send__(:descendants) # Rails 3
14
+ rescue
15
+ klasses = ::ActiveResource::Base.__send__(:subclasses) # Rails 2
16
+ end
17
+
18
+ klasses.select do |klass|
19
+ !except_classes.include?(klass.name)
20
+ end
21
+ end
22
+
23
+ # Return list of column/property names
24
+ def column_names
25
+ klass.column_names
26
+ end
27
+
28
+ # @see OrmAdapter::Base#get!
29
+ def get!(id)
30
+ klass.find(wrap_key(id))
31
+ end
32
+
33
+ # @see OrmAdapter::Base#get
34
+ def get(id)
35
+ klass.find(:first, :params => {:id => wrap_key(id)})
36
+ end
37
+
38
+ # @see OrmAdapter::Base#find_first
39
+ def find_first(options)
40
+ conditions, order = extract_conditions_and_order!(options)
41
+ klass.find(:first, :params => conditions_to_fields(conditions).merge(order_clause(order)))
42
+ end
43
+
44
+ # @see OrmAdapter::Base#find_all
45
+ def find_all(options)
46
+ conditions, order = extract_conditions_and_order!(options)
47
+ klass.find(:all, :params => conditions_to_fields(conditions).merge(order_clause(order)))
48
+ end
49
+
50
+ # @see OrmAdapter::Base#create!
51
+ def create!(attributes)
52
+ klass.create(attributes)
53
+ end
54
+
55
+ protected
56
+ # Introspects the klass to convert and objects in conditions into foreign key and type fields
57
+ def conditions_to_fields(conditions)
58
+ fields = {}
59
+ conditions.each do |key, value|
60
+ if klass.schema && !klass.schema[key] && klass.schema[key.to_s + "_id"]
61
+ fields[key.to_s + "_id"] = value
62
+ else
63
+ fields[key] = value
64
+ end
65
+ end
66
+ fields
67
+ end
68
+
69
+ def order_clause(order)
70
+ {:order => order.map {|pair| "#{pair[0]} #{pair[1]}"}.join(",")}
71
+ end
72
+ end
73
+ end
74
+
75
+ class ActiveResource::Base
76
+ extend ::OrmAdapter::ToAdapter
77
+ self::OrmAdapter = ::OrmAdapter::ActiveResource
78
+ end
@@ -0,0 +1,2 @@
1
+ require 'orm_adapter'
2
+ require 'orm_adapter/adapters/activeresource'
@@ -0,0 +1,21 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "orm_adapter_activeresource"
5
+ s.version = "0.0.1"
6
+ s.platform = Gem::Platform::RUBY
7
+ s.authors = ["Lukas Fittl"]
8
+ s.description = "Extends orm_adapter with support for ActiveResource"
9
+ s.summary = "Extends the orm_adapter ORM abstraction layer with support for Rails' ActiveResource REST-based ORM."
10
+ s.email = "lukas@fittl.com"
11
+ s.homepage = "http://github.com/lfittl/orm_adapter_activeresource"
12
+
13
+ s.rubyforge_project = "orm_adapter_activeresource"
14
+ s.required_rubygems_version = ">= 1.3.6"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.require_paths = ["lib"]
19
+
20
+ s.add_development_dependency "orm_adapter", ">= 0.0.7"
21
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../server', __FILE__)
4
+ run ActiveResourceServer::Application
@@ -0,0 +1,55 @@
1
+ class Hash
2
+ def only(*whitelist)
3
+ {}.tap do |h|
4
+ (keys & whitelist).each { |k| h[k] = self[k] }
5
+ end
6
+ end
7
+ end
8
+
9
+ class UsersController < ActionController::Base
10
+ respond_to :json
11
+
12
+ def index
13
+ respond_with(@users = User.where(params.only('name', 'rating')).order(params[:order]))
14
+ end
15
+
16
+ def create
17
+ params[:user][:notes].map! {|n| Note.find(n[:note][:id]) } rescue nil
18
+ @user = User.create(params[:user])
19
+ respond_with(@user)
20
+ end
21
+
22
+ def show
23
+ respond_with(@user = User.find(params[:id]))
24
+ end
25
+
26
+ def destroy
27
+ @user = User.find(params[:id])
28
+ @user.destroy
29
+ head :ok
30
+ end
31
+ end
32
+
33
+ class NotesController < ActionController::Base
34
+ respond_to :json
35
+
36
+ def index
37
+ respond_with(@notes = Note.where(params.only('owner_id')).order(params[:order]))
38
+ end
39
+
40
+ def show
41
+ respond_with Note.find(params[:id])
42
+ end
43
+
44
+ def create
45
+ params[:note][:owner] = User.find_by_id(params[:note][:owner_id] || params[:note][:owner][:user][:id]) rescue nil
46
+ @note = Note.create(params[:note])
47
+ respond_with(@note)
48
+ end
49
+
50
+ def destroy
51
+ @note = Note.find(params[:id])
52
+ @note.destroy
53
+ head :ok
54
+ end
55
+ end
@@ -0,0 +1,7 @@
1
+ class User < ActiveRecord::Base
2
+ has_many :notes, :foreign_key => 'owner_id'
3
+ end
4
+
5
+ class Note < ActiveRecord::Base
6
+ belongs_to :owner, :class_name => "User"
7
+ end
@@ -0,0 +1,829 @@
1
+ [2012-05-08 00:39:21] INFO WEBrick 1.3.1
2
+ [2012-05-08 00:39:21] INFO ruby 1.9.2 (2011-07-09) [x86_64-darwin10.8.0]
3
+ [2012-05-08 00:39:21] INFO WEBrick::HTTPServer#start: pid=40871 port=31777
4
+ 127.0.0.1 - - [08/May/2012 00:39:22] "GET /users.json HTTP/1.1" 200 - 0.0744
5
+ 127.0.0.1 - - [08/May/2012 00:39:22] "GET /notes.json HTTP/1.1" 200 - 0.0081
6
+ 127.0.0.1 - - [08/May/2012 00:39:22] "GET /users.json HTTP/1.1" 200 - 0.0061
7
+ 127.0.0.1 - - [08/May/2012 00:39:22] "GET /notes.json HTTP/1.1" 200 - 0.0059
8
+ 127.0.0.1 - - [08/May/2012 00:39:22] "GET /users.json HTTP/1.1" 200 - 0.0049
9
+ 127.0.0.1 - - [08/May/2012 00:39:22] "GET /notes.json HTTP/1.1" 200 - 0.0048
10
+ 127.0.0.1 - - [08/May/2012 00:39:22] "GET /users.json HTTP/1.1" 200 - 0.0049
11
+ 127.0.0.1 - - [08/May/2012 00:39:22] "GET /notes.json HTTP/1.1" 200 - 0.0048
12
+ 127.0.0.1 - - [08/May/2012 00:39:22] "GET /users.json HTTP/1.1" 200 - 0.0054
13
+ 127.0.0.1 - - [08/May/2012 00:39:22] "GET /notes.json HTTP/1.1" 200 - 0.0048
14
+ 127.0.0.1 - - [08/May/2012 00:39:23] "POST /users.json HTTP/1.1" 201 - 0.0787
15
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users/1.json HTTP/1.1" 200 - 0.0071
16
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users.json HTTP/1.1" 200 - 0.0125
17
+ 127.0.0.1 - - [08/May/2012 00:39:23] "DELETE /users/1.json HTTP/1.1" 200 - 0.0803
18
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /notes.json HTTP/1.1" 200 - 0.0067
19
+ 127.0.0.1 - - [08/May/2012 00:39:23] "POST /users.json HTTP/1.1" 201 - 0.0525
20
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users/2.json HTTP/1.1" 200 - 0.0054
21
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users.json HTTP/1.1" 200 - 0.0229
22
+ 127.0.0.1 - - [08/May/2012 00:39:23] "DELETE /users/2.json HTTP/1.1" 200 - 0.0043
23
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /notes.json HTTP/1.1" 200 - 0.0049
24
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users/non-exitent%20id.json HTTP/1.1" 404 25582 0.0222
25
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users.json HTTP/1.1" 200 - 0.0053
26
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /notes.json HTTP/1.1" 200 - 0.0049
27
+ 127.0.0.1 - - [08/May/2012 00:39:23] "POST /users.json HTTP/1.1" 201 - 0.0077
28
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users.json?id=3 HTTP/1.1" 200 - 0.0052
29
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users.json HTTP/1.1" 200 - 0.0049
30
+ 127.0.0.1 - - [08/May/2012 00:39:23] "DELETE /users/3.json HTTP/1.1" 200 - 0.0040
31
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /notes.json HTTP/1.1" 200 - 0.0048
32
+ 127.0.0.1 - - [08/May/2012 00:39:23] "POST /users.json HTTP/1.1" 201 - 0.0255
33
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users.json?id=4 HTTP/1.1" 200 - 0.0054
34
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users.json HTTP/1.1" 200 - 0.0051
35
+ 127.0.0.1 - - [08/May/2012 00:39:23] "DELETE /users/4.json HTTP/1.1" 200 - 0.0043
36
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /notes.json HTTP/1.1" 200 - 0.0050
37
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users.json?id=non-exitent+id HTTP/1.1" 200 - 0.0049
38
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users.json HTTP/1.1" 200 - 0.0049
39
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /notes.json HTTP/1.1" 200 - 0.0046
40
+ 127.0.0.1 - - [08/May/2012 00:39:23] "POST /users.json HTTP/1.1" 201 - 0.0074
41
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users.json?name=Fred&order= HTTP/1.1" 200 - 0.0082
42
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users.json HTTP/1.1" 200 - 0.0060
43
+ 127.0.0.1 - - [08/May/2012 00:39:23] "DELETE /users/5.json HTTP/1.1" 200 - 0.0049
44
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /notes.json HTTP/1.1" 200 - 0.0053
45
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users.json?name=Betty&order= HTTP/1.1" 200 - 0.0049
46
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users.json HTTP/1.1" 200 - 0.0240
47
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /notes.json HTTP/1.1" 200 - 0.0048
48
+ 127.0.0.1 - - [08/May/2012 00:39:23] "POST /users.json HTTP/1.1" 201 - 0.0076
49
+ 127.0.0.1 - - [08/May/2012 00:39:23] "POST /users.json HTTP/1.1" 201 - 0.0076
50
+ 127.0.0.1 - - [08/May/2012 00:39:23] "POST /notes.json HTTP/1.1" 201 - 0.0120
51
+ 127.0.0.1 - - [08/May/2012 00:39:23] "POST /notes.json HTTP/1.1" 201 - 0.0094
52
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /notes.json?order=&owner_id=6 HTTP/1.1" 200 - 0.0051
53
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users.json HTTP/1.1" 200 - 0.0053
54
+ 127.0.0.1 - - [08/May/2012 00:39:23] "DELETE /users/6.json HTTP/1.1" 200 - 0.0047
55
+ 127.0.0.1 - - [08/May/2012 00:39:23] "DELETE /users/7.json HTTP/1.1" 200 - 0.0038
56
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /notes.json HTTP/1.1" 200 - 0.0053
57
+ 127.0.0.1 - - [08/May/2012 00:39:23] "DELETE /notes/1.json HTTP/1.1" 200 - 0.0047
58
+ 127.0.0.1 - - [08/May/2012 00:39:23] "DELETE /notes/2.json HTTP/1.1" 200 - 0.0241
59
+ 127.0.0.1 - - [08/May/2012 00:39:23] "POST /users.json HTTP/1.1" 201 - 0.0078
60
+ 127.0.0.1 - - [08/May/2012 00:39:23] "POST /users.json HTTP/1.1" 201 - 0.0072
61
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users.json?order=name+asc%2Crating+desc HTTP/1.1" 200 - 0.0054
62
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users.json HTTP/1.1" 200 - 0.0049
63
+ 127.0.0.1 - - [08/May/2012 00:39:23] "DELETE /users/8.json HTTP/1.1" 200 - 0.0041
64
+ 127.0.0.1 - - [08/May/2012 00:39:23] "DELETE /users/9.json HTTP/1.1" 200 - 0.0036
65
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /notes.json HTTP/1.1" 200 - 0.0049
66
+ 127.0.0.1 - - [08/May/2012 00:39:23] "POST /users.json HTTP/1.1" 201 - 0.0079
67
+ 127.0.0.1 - - [08/May/2012 00:39:23] "POST /users.json HTTP/1.1" 201 - 0.0073
68
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users.json?name=Fred&order=rating+desc HTTP/1.1" 200 - 0.0057
69
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users.json HTTP/1.1" 200 - 0.0050
70
+ 127.0.0.1 - - [08/May/2012 00:39:23] "DELETE /users/10.json HTTP/1.1" 200 - 0.0039
71
+ 127.0.0.1 - - [08/May/2012 00:39:23] "DELETE /users/11.json HTTP/1.1" 200 - 0.0229
72
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /notes.json HTTP/1.1" 200 - 0.0055
73
+ 127.0.0.1 - - [08/May/2012 00:39:23] "POST /users.json HTTP/1.1" 201 - 0.0077
74
+ 127.0.0.1 - - [08/May/2012 00:39:23] "POST /users.json HTTP/1.1" 201 - 0.0071
75
+ 127.0.0.1 - - [08/May/2012 00:39:23] "POST /users.json HTTP/1.1" 201 - 0.0068
76
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users.json?name=Fred&order= HTTP/1.1" 200 - 0.0052
77
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users.json HTTP/1.1" 200 - 0.0052
78
+ 127.0.0.1 - - [08/May/2012 00:39:23] "DELETE /users/12.json HTTP/1.1" 200 - 0.0039
79
+ 127.0.0.1 - - [08/May/2012 00:39:23] "DELETE /users/13.json HTTP/1.1" 200 - 0.0039
80
+ 127.0.0.1 - - [08/May/2012 00:39:23] "DELETE /users/14.json HTTP/1.1" 200 - 0.0034
81
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /notes.json HTTP/1.1" 200 - 0.0046
82
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users.json?name=Fred&order= HTTP/1.1" 200 - 0.0049
83
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /users.json HTTP/1.1" 200 - 0.0049
84
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /notes.json HTTP/1.1" 200 - 0.0049
85
+ 127.0.0.1 - - [08/May/2012 00:39:23] "POST /users.json HTTP/1.1" 201 - 0.0265
86
+ 127.0.0.1 - - [08/May/2012 00:39:23] "POST /users.json HTTP/1.1" 201 - 0.0072
87
+ 127.0.0.1 - - [08/May/2012 00:39:23] "POST /notes.json HTTP/1.1" 201 - 0.0084
88
+ 127.0.0.1 - - [08/May/2012 00:39:23] "POST /notes.json HTTP/1.1" 201 - 0.0082
89
+ 127.0.0.1 - - [08/May/2012 00:39:23] "GET /notes.json?order=&owner_id=16 HTTP/1.1" 200 - 0.0051
90
+ 127.0.0.1 - - [08/May/2012 00:39:24] "GET /users.json HTTP/1.1" 200 - 0.0050
91
+ 127.0.0.1 - - [08/May/2012 00:39:24] "DELETE /users/15.json HTTP/1.1" 200 - 0.0043
92
+ 127.0.0.1 - - [08/May/2012 00:39:24] "DELETE /users/16.json HTTP/1.1" 200 - 0.0037
93
+ 127.0.0.1 - - [08/May/2012 00:39:24] "GET /notes.json HTTP/1.1" 200 - 0.0053
94
+ 127.0.0.1 - - [08/May/2012 00:39:24] "DELETE /notes/3.json HTTP/1.1" 200 - 0.0044
95
+ 127.0.0.1 - - [08/May/2012 00:39:24] "DELETE /notes/4.json HTTP/1.1" 200 - 0.0040
96
+ 127.0.0.1 - - [08/May/2012 00:39:24] "POST /users.json HTTP/1.1" 201 - 0.0080
97
+ 127.0.0.1 - - [08/May/2012 00:39:24] "POST /users.json HTTP/1.1" 201 - 0.0072
98
+ 127.0.0.1 - - [08/May/2012 00:39:24] "POST /users.json HTTP/1.1" 201 - 0.0262
99
+ 127.0.0.1 - - [08/May/2012 00:39:24] "GET /users.json?order=name+asc%2Crating+desc HTTP/1.1" 200 - 0.0056
100
+ 127.0.0.1 - - [08/May/2012 00:39:24] "GET /users.json HTTP/1.1" 200 - 0.0050
101
+ 127.0.0.1 - - [08/May/2012 00:39:24] "DELETE /users/17.json HTTP/1.1" 200 - 0.0041
102
+ 127.0.0.1 - - [08/May/2012 00:39:24] "DELETE /users/18.json HTTP/1.1" 200 - 0.0038
103
+ 127.0.0.1 - - [08/May/2012 00:39:24] "DELETE /users/19.json HTTP/1.1" 200 - 0.0037
104
+ 127.0.0.1 - - [08/May/2012 00:39:24] "GET /notes.json HTTP/1.1" 200 - 0.0048
105
+ 127.0.0.1 - - [08/May/2012 00:39:24] "POST /users.json HTTP/1.1" 201 - 0.0074
106
+ 127.0.0.1 - - [08/May/2012 00:39:24] "POST /users.json HTTP/1.1" 201 - 0.0074
107
+ 127.0.0.1 - - [08/May/2012 00:39:24] "POST /users.json HTTP/1.1" 201 - 0.0072
108
+ 127.0.0.1 - - [08/May/2012 00:39:24] "GET /users.json?name=Fred&order=rating+desc HTTP/1.1" 200 - 0.0054
109
+ 127.0.0.1 - - [08/May/2012 00:39:24] "GET /users.json HTTP/1.1" 200 - 0.0051
110
+ 127.0.0.1 - - [08/May/2012 00:39:24] "DELETE /users/20.json HTTP/1.1" 200 - 0.0039
111
+ 127.0.0.1 - - [08/May/2012 00:39:24] "DELETE /users/21.json HTTP/1.1" 200 - 0.0222
112
+ 127.0.0.1 - - [08/May/2012 00:39:24] "DELETE /users/22.json HTTP/1.1" 200 - 0.0045
113
+ 127.0.0.1 - - [08/May/2012 00:39:24] "GET /notes.json HTTP/1.1" 200 - 0.0051
114
+ 127.0.0.1 - - [08/May/2012 00:39:24] "POST /users.json HTTP/1.1" 201 - 0.0073
115
+ 127.0.0.1 - - [08/May/2012 00:39:24] "GET /users/23.json HTTP/1.1" 200 - 0.0051
116
+ 127.0.0.1 - - [08/May/2012 00:39:24] "GET /users.json HTTP/1.1" 200 - 0.0048
117
+ 127.0.0.1 - - [08/May/2012 00:39:24] "DELETE /users/23.json HTTP/1.1" 200 - 0.0039
118
+ 127.0.0.1 - - [08/May/2012 00:39:24] "GET /notes.json HTTP/1.1" 200 - 0.0048
119
+ 127.0.0.1 - - [08/May/2012 00:39:24] "POST /notes.json HTTP/1.1" 201 - 0.0073
120
+ 127.0.0.1 - - [08/May/2012 00:39:24] "GET /users.json HTTP/1.1" 200 - 0.0051
121
+ 127.0.0.1 - - [08/May/2012 00:39:24] "GET /notes.json HTTP/1.1" 200 - 0.0048
122
+ 127.0.0.1 - - [08/May/2012 00:39:24] "DELETE /notes/5.json HTTP/1.1" 200 - 0.0041
123
+ 127.0.0.1 - - [08/May/2012 00:39:24] "POST /users.json HTTP/1.1" 201 - 0.0075
124
+ 127.0.0.1 - - [08/May/2012 00:39:24] "POST /notes.json HTTP/1.1" 201 - 0.0078
125
+ 127.0.0.1 - - [08/May/2012 00:39:24] "GET /notes/6.json HTTP/1.1" 200 - 0.0232
126
+ 127.0.0.1 - - [08/May/2012 00:39:24] "GET /users/24.json HTTP/1.1" 200 - 0.0052
127
+ 127.0.0.1 - - [08/May/2012 00:39:24] "GET /users.json HTTP/1.1" 200 - 0.0052
128
+ 127.0.0.1 - - [08/May/2012 00:39:24] "DELETE /users/24.json HTTP/1.1" 200 - 0.0040
129
+ 127.0.0.1 - - [08/May/2012 00:39:24] "GET /notes.json HTTP/1.1" 200 - 0.0062
130
+ 127.0.0.1 - - [08/May/2012 00:39:24] "DELETE /notes/6.json HTTP/1.1" 200 - 0.0043
131
+ 127.0.0.1 - - [08/May/2012 00:39:24] "POST /notes.json HTTP/1.1" 201 - 0.0070
132
+ 127.0.0.1 - - [08/May/2012 00:39:24] "POST /notes.json HTTP/1.1" 201 - 0.0078
133
+ 127.0.0.1 - - [08/May/2012 00:39:24] "POST /users.json HTTP/1.1" 201 - 0.0107
134
+ 127.0.0.1 - - [08/May/2012 00:39:24] "GET /users/25.json HTTP/1.1" 200 - 0.0050
135
+ 127.0.0.1 - - [08/May/2012 00:39:24] "GET /notes.json?owner_id=25 HTTP/1.1" 200 - 0.0052
136
+ 0.2ms)
137
+
138
+
139
+ Started GET "/users.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
140
+ Processing by UsersController#index as JSON
141
+ User Load (0.2ms) SELECT "users".* FROM "users"
142
+ Completed 200 OK in 3ms (Views: 1.1ms | ActiveRecord: 0.2ms)
143
+
144
+
145
+ Started GET "/notes.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
146
+ Processing by NotesController#index as JSON
147
+ Note Load (0.2ms) SELECT "notes".* FROM "notes"
148
+ Completed 200 OK in 3ms (Views: 1.1ms | ActiveRecord: 0.2ms)
149
+
150
+
151
+ Started POST "/users.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
152
+ Processing by UsersController#create as JSON
153
+ Parameters: {"user"=>{"name"=>"Fred"}}
154
+ AREL (0.2ms) INSERT INTO "users" ("name", "rating") VALUES ('Fred', NULL)
155
+ Completed 201 Created in 6ms (Views: 1.4ms | ActiveRecord: 0.0ms)
156
+
157
+
158
+ Started GET "/users.json?name=Fred&order=" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
159
+ Processing by UsersController#index as JSON
160
+ Parameters: {"name"=>"Fred", "order"=>""}
161
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = 'Fred'
162
+ Completed 200 OK in 6ms (Views: 1.4ms | ActiveRecord: 0.3ms)
163
+
164
+
165
+ Started GET "/users.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
166
+ Processing by UsersController#index as JSON
167
+ User Load (0.3ms) SELECT "users".* FROM "users"
168
+ Completed 200 OK in 4ms (Views: 1.4ms | ActiveRecord: 0.3ms)
169
+
170
+
171
+ Started DELETE "/users/5.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
172
+ Processing by UsersController#destroy as JSON
173
+ Parameters: {"id"=>"5"}
174
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 5 LIMIT 1
175
+ AREL (0.2ms) DELETE FROM "users" WHERE "users"."id" = 5
176
+ Completed 200 OK in 3ms
177
+
178
+
179
+ Started GET "/notes.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
180
+ Processing by NotesController#index as JSON
181
+ Note Load (0.3ms) SELECT "notes".* FROM "notes"
182
+ Completed 200 OK in 3ms (Views: 1.2ms | ActiveRecord: 0.3ms)
183
+
184
+
185
+ Started GET "/users.json?name=Betty&order=" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
186
+ Processing by UsersController#index as JSON
187
+ Parameters: {"name"=>"Betty", "order"=>""}
188
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = 'Betty'
189
+ Completed 200 OK in 3ms (Views: 1.1ms | ActiveRecord: 0.2ms)
190
+
191
+
192
+ Started GET "/users.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
193
+ Processing by UsersController#index as JSON
194
+ User Load (0.3ms) SELECT "users".* FROM "users"
195
+ Completed 200 OK in 4ms (Views: 1.2ms | ActiveRecord: 0.3ms)
196
+
197
+
198
+ Started GET "/notes.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
199
+ Processing by NotesController#index as JSON
200
+ Note Load (0.2ms) SELECT "notes".* FROM "notes"
201
+ Completed 200 OK in 3ms (Views: 1.0ms | ActiveRecord: 0.2ms)
202
+
203
+
204
+ Started POST "/users.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
205
+ Processing by UsersController#create as JSON
206
+ Parameters: {"user"=>{}}
207
+ AREL (0.2ms) INSERT INTO "users" ("name", "rating") VALUES (NULL, NULL)
208
+ Completed 201 Created in 6ms (Views: 1.5ms | ActiveRecord: 0.0ms)
209
+
210
+
211
+ Started POST "/users.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
212
+ Processing by UsersController#create as JSON
213
+ Parameters: {"user"=>{}}
214
+ AREL (0.2ms) INSERT INTO "users" ("name", "rating") VALUES (NULL, NULL)
215
+ Completed 201 Created in 6ms (Views: 1.5ms | ActiveRecord: 0.0ms)
216
+
217
+
218
+ Started POST "/notes.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
219
+ Processing by NotesController#create as JSON
220
+ Parameters: {"note"=>{"owner"=>{"user"=>{"id"=>7, "name"=>nil, "rating"=>nil}}}}
221
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 7 LIMIT 1
222
+ AREL (0.2ms) INSERT INTO "notes" ("owner_id", "owner_type") VALUES (7, NULL)
223
+ Completed 201 Created in 10ms (Views: 1.7ms | ActiveRecord: 0.0ms)
224
+
225
+
226
+ Started POST "/notes.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
227
+ Processing by NotesController#create as JSON
228
+ Parameters: {"note"=>{"owner"=>{"user"=>{"id"=>6, "name"=>nil, "rating"=>nil}}}}
229
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 6 LIMIT 1
230
+ AREL (0.2ms) INSERT INTO "notes" ("owner_id", "owner_type") VALUES (6, NULL)
231
+ Completed 201 Created in 6ms (Views: 1.5ms | ActiveRecord: 0.0ms)
232
+
233
+
234
+ Started GET "/notes.json?order=&owner_id=6" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
235
+ Processing by NotesController#index as JSON
236
+ Parameters: {"order"=>"", "owner_id"=>"6"}
237
+ Note Load (0.3ms) SELECT "notes".* FROM "notes" WHERE "notes"."owner_id" = 6
238
+ Completed 200 OK in 3ms (Views: 1.3ms | ActiveRecord: 0.3ms)
239
+
240
+
241
+ Started GET "/users.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
242
+ Processing by UsersController#index as JSON
243
+ User Load (0.2ms) SELECT "users".* FROM "users"
244
+ Completed 200 OK in 4ms (Views: 1.4ms | ActiveRecord: 0.2ms)
245
+
246
+
247
+ Started DELETE "/users/6.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
248
+ Processing by UsersController#destroy as JSON
249
+ Parameters: {"id"=>"6"}
250
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 6 LIMIT 1
251
+ AREL (0.2ms) DELETE FROM "users" WHERE "users"."id" = 6
252
+ Completed 200 OK in 3ms
253
+
254
+
255
+ Started DELETE "/users/7.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
256
+ Processing by UsersController#destroy as JSON
257
+ Parameters: {"id"=>"7"}
258
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 7 LIMIT 1
259
+ AREL (0.2ms) DELETE FROM "users" WHERE "users"."id" = 7
260
+ Completed 200 OK in 2ms
261
+
262
+
263
+ Started GET "/notes.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
264
+ Processing by NotesController#index as JSON
265
+ Note Load (0.3ms) SELECT "notes".* FROM "notes"
266
+ Completed 200 OK in 4ms (Views: 1.4ms | ActiveRecord: 0.3ms)
267
+
268
+
269
+ Started DELETE "/notes/1.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
270
+ Processing by NotesController#destroy as JSON
271
+ Parameters: {"id"=>"1"}
272
+ Note Load (0.3ms) SELECT "notes".* FROM "notes" WHERE "notes"."id" = 1 LIMIT 1
273
+ AREL (0.2ms) DELETE FROM "notes" WHERE "notes"."id" = 1
274
+ Completed 200 OK in 3ms
275
+
276
+
277
+ Started DELETE "/notes/2.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
278
+ Processing by NotesController#destroy as JSON
279
+ Parameters: {"id"=>"2"}
280
+ Note Load (0.3ms) SELECT "notes".* FROM "notes" WHERE "notes"."id" = 2 LIMIT 1
281
+ AREL (0.2ms) DELETE FROM "notes" WHERE "notes"."id" = 2
282
+ Completed 200 OK in 3ms
283
+
284
+
285
+ Started POST "/users.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
286
+ Processing by UsersController#create as JSON
287
+ Parameters: {"user"=>{"name"=>"Fred", "rating"=>1}}
288
+ AREL (0.2ms) INSERT INTO "users" ("name", "rating") VALUES ('Fred', 1)
289
+ Completed 201 Created in 6ms (Views: 1.6ms | ActiveRecord: 0.0ms)
290
+
291
+
292
+ Started POST "/users.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
293
+ Processing by UsersController#create as JSON
294
+ Parameters: {"user"=>{"name"=>"Fred", "rating"=>2}}
295
+ AREL (0.2ms) INSERT INTO "users" ("name", "rating") VALUES ('Fred', 2)
296
+ Completed 201 Created in 5ms (Views: 1.4ms | ActiveRecord: 0.0ms)
297
+
298
+
299
+ Started GET "/users.json?order=name+asc%2Crating+desc" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
300
+ Processing by UsersController#index as JSON
301
+ Parameters: {"order"=>"name asc,rating desc"}
302
+ User Load (0.3ms) SELECT "users".* FROM "users" ORDER BY name asc,rating desc
303
+ Completed 200 OK in 4ms (Views: 1.4ms | ActiveRecord: 0.3ms)
304
+
305
+
306
+ Started GET "/users.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
307
+ Processing by UsersController#index as JSON
308
+ User Load (0.3ms) SELECT "users".* FROM "users"
309
+ Completed 200 OK in 3ms (Views: 1.4ms | ActiveRecord: 0.3ms)
310
+
311
+
312
+ Started DELETE "/users/8.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
313
+ Processing by UsersController#destroy as JSON
314
+ Parameters: {"id"=>"8"}
315
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 8 LIMIT 1
316
+ AREL (0.2ms) DELETE FROM "users" WHERE "users"."id" = 8
317
+ Completed 200 OK in 3ms
318
+
319
+
320
+ Started DELETE "/users/9.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
321
+ Processing by UsersController#destroy as JSON
322
+ Parameters: {"id"=>"9"}
323
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 9 LIMIT 1
324
+ AREL (0.2ms) DELETE FROM "users" WHERE "users"."id" = 9
325
+ Completed 200 OK in 2ms
326
+
327
+
328
+ Started GET "/notes.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
329
+ Processing by NotesController#index as JSON
330
+ Note Load (0.2ms) SELECT "notes".* FROM "notes"
331
+ Completed 200 OK in 3ms (Views: 1.1ms | ActiveRecord: 0.2ms)
332
+
333
+
334
+ Started POST "/users.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
335
+ Processing by UsersController#create as JSON
336
+ Parameters: {"user"=>{"name"=>"Fred", "rating"=>1}}
337
+ AREL (0.2ms) INSERT INTO "users" ("name", "rating") VALUES ('Fred', 1)
338
+ Completed 201 Created in 6ms (Views: 1.6ms | ActiveRecord: 0.0ms)
339
+
340
+
341
+ Started POST "/users.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
342
+ Processing by UsersController#create as JSON
343
+ Parameters: {"user"=>{"name"=>"Fred", "rating"=>2}}
344
+ AREL (0.2ms) INSERT INTO "users" ("name", "rating") VALUES ('Fred', 2)
345
+ Completed 201 Created in 5ms (Views: 1.6ms | ActiveRecord: 0.0ms)
346
+
347
+
348
+ Started GET "/users.json?name=Fred&order=rating+desc" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
349
+ Processing by UsersController#index as JSON
350
+ Parameters: {"name"=>"Fred", "order"=>"rating desc"}
351
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = 'Fred' ORDER BY rating desc
352
+ Completed 200 OK in 4ms (Views: 1.5ms | ActiveRecord: 0.3ms)
353
+
354
+
355
+ Started GET "/users.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
356
+ Processing by UsersController#index as JSON
357
+ User Load (0.2ms) SELECT "users".* FROM "users"
358
+ Completed 200 OK in 3ms (Views: 1.4ms | ActiveRecord: 0.2ms)
359
+
360
+
361
+ Started DELETE "/users/10.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
362
+ Processing by UsersController#destroy as JSON
363
+ Parameters: {"id"=>"10"}
364
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 10 LIMIT 1
365
+ AREL (0.2ms) DELETE FROM "users" WHERE "users"."id" = 10
366
+ Completed 200 OK in 2ms
367
+
368
+
369
+ Started DELETE "/users/11.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
370
+ Processing by UsersController#destroy as JSON
371
+ Parameters: {"id"=>"11"}
372
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 11 LIMIT 1
373
+ AREL (0.2ms) DELETE FROM "users" WHERE "users"."id" = 11
374
+ Completed 200 OK in 21ms
375
+
376
+
377
+ Started GET "/notes.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
378
+ Processing by NotesController#index as JSON
379
+ Note Load (0.3ms) SELECT "notes".* FROM "notes"
380
+ Completed 200 OK in 4ms (Views: 1.3ms | ActiveRecord: 0.3ms)
381
+
382
+
383
+ Started POST "/users.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
384
+ Processing by UsersController#create as JSON
385
+ Parameters: {"user"=>{"name"=>"Fred"}}
386
+ AREL (0.2ms) INSERT INTO "users" ("name", "rating") VALUES ('Fred', NULL)
387
+ Completed 201 Created in 6ms (Views: 1.6ms | ActiveRecord: 0.0ms)
388
+
389
+
390
+ Started POST "/users.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
391
+ Processing by UsersController#create as JSON
392
+ Parameters: {"user"=>{"name"=>"Fred"}}
393
+ AREL (0.2ms) INSERT INTO "users" ("name", "rating") VALUES ('Fred', NULL)
394
+ Completed 201 Created in 5ms (Views: 1.5ms | ActiveRecord: 0.0ms)
395
+
396
+
397
+ Started POST "/users.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
398
+ Processing by UsersController#create as JSON
399
+ Parameters: {"user"=>{"name"=>"Betty"}}
400
+ AREL (0.2ms) INSERT INTO "users" ("name", "rating") VALUES ('Betty', NULL)
401
+ Completed 201 Created in 5ms (Views: 1.4ms | ActiveRecord: 0.0ms)
402
+
403
+
404
+ Started GET "/users.json?name=Fred&order=" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
405
+ Processing by UsersController#index as JSON
406
+ Parameters: {"name"=>"Fred", "order"=>""}
407
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = 'Fred'
408
+ Completed 200 OK in 3ms (Views: 1.4ms | ActiveRecord: 0.3ms)
409
+
410
+
411
+ Started GET "/users.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
412
+ Processing by UsersController#index as JSON
413
+ User Load (0.3ms) SELECT "users".* FROM "users"
414
+ Completed 200 OK in 4ms (Views: 1.5ms | ActiveRecord: 0.3ms)
415
+
416
+
417
+ Started DELETE "/users/12.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
418
+ Processing by UsersController#destroy as JSON
419
+ Parameters: {"id"=>"12"}
420
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 12 LIMIT 1
421
+ AREL (0.2ms) DELETE FROM "users" WHERE "users"."id" = 12
422
+ Completed 200 OK in 2ms
423
+
424
+
425
+ Started DELETE "/users/13.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
426
+ Processing by UsersController#destroy as JSON
427
+ Parameters: {"id"=>"13"}
428
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 13 LIMIT 1
429
+ AREL (0.2ms) DELETE FROM "users" WHERE "users"."id" = 13
430
+ Completed 200 OK in 2ms
431
+
432
+
433
+ Started DELETE "/users/14.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
434
+ Processing by UsersController#destroy as JSON
435
+ Parameters: {"id"=>"14"}
436
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 14 LIMIT 1
437
+ AREL (0.2ms) DELETE FROM "users" WHERE "users"."id" = 14
438
+ Completed 200 OK in 2ms
439
+
440
+
441
+ Started GET "/notes.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
442
+ Processing by NotesController#index as JSON
443
+ Note Load (0.2ms) SELECT "notes".* FROM "notes"
444
+ Completed 200 OK in 3ms (Views: 1.0ms | ActiveRecord: 0.2ms)
445
+
446
+
447
+ Started GET "/users.json?name=Fred&order=" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
448
+ Processing by UsersController#index as JSON
449
+ Parameters: {"name"=>"Fred", "order"=>""}
450
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = 'Fred'
451
+ Completed 200 OK in 3ms (Views: 1.0ms | ActiveRecord: 0.2ms)
452
+
453
+
454
+ Started GET "/users.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
455
+ Processing by UsersController#index as JSON
456
+ User Load (0.3ms) SELECT "users".* FROM "users"
457
+ Completed 200 OK in 3ms (Views: 1.1ms | ActiveRecord: 0.3ms)
458
+
459
+
460
+ Started GET "/notes.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
461
+ Processing by NotesController#index as JSON
462
+ Note Load (0.2ms) SELECT "notes".* FROM "notes"
463
+ Completed 200 OK in 3ms (Views: 1.1ms | ActiveRecord: 0.2ms)
464
+
465
+
466
+ Started POST "/users.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
467
+ Processing by UsersController#create as JSON
468
+ Parameters: {"user"=>{}}
469
+ AREL (0.2ms) INSERT INTO "users" ("name", "rating") VALUES (NULL, NULL)
470
+ Completed 201 Created in 7ms (Views: 1.6ms | ActiveRecord: 0.0ms)
471
+
472
+
473
+ Started POST "/users.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
474
+ Processing by UsersController#create as JSON
475
+ Parameters: {"user"=>{}}
476
+ AREL (0.2ms) INSERT INTO "users" ("name", "rating") VALUES (NULL, NULL)
477
+ Completed 201 Created in 5ms (Views: 1.4ms | ActiveRecord: 0.0ms)
478
+
479
+
480
+ Started POST "/notes.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
481
+ Processing by NotesController#create as JSON
482
+ Parameters: {"note"=>{"owner"=>{"user"=>{"id"=>15, "name"=>nil, "rating"=>nil}}}}
483
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 15 LIMIT 1
484
+ AREL (0.2ms) INSERT INTO "notes" ("owner_id", "owner_type") VALUES (15, NULL)
485
+ Completed 201 Created in 6ms (Views: 1.5ms | ActiveRecord: 0.0ms)
486
+
487
+
488
+ Started POST "/notes.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
489
+ Processing by NotesController#create as JSON
490
+ Parameters: {"note"=>{"owner"=>{"user"=>{"id"=>16, "name"=>nil, "rating"=>nil}}}}
491
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 16 LIMIT 1
492
+ AREL (0.2ms) INSERT INTO "notes" ("owner_id", "owner_type") VALUES (16, NULL)
493
+ Completed 201 Created in 6ms (Views: 1.5ms | ActiveRecord: 0.0ms)
494
+
495
+
496
+ Started GET "/notes.json?order=&owner_id=16" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
497
+ Processing by NotesController#index as JSON
498
+ Parameters: {"order"=>"", "owner_id"=>"16"}
499
+ Note Load (0.2ms) SELECT "notes".* FROM "notes" WHERE "notes"."owner_id" = 16
500
+ Completed 200 OK in 3ms (Views: 1.2ms | ActiveRecord: 0.2ms)
501
+
502
+
503
+ Started GET "/users.json" for 127.0.0.1 at 2012-05-08 00:39:23 +0200
504
+ Processing by UsersController#index as JSON
505
+ User Load (0.3ms) SELECT "users".* FROM "users"
506
+ Completed 200 OK in 3ms (Views: 1.4ms | ActiveRecord: 0.3ms)
507
+
508
+
509
+ Started DELETE "/users/15.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
510
+ Processing by UsersController#destroy as JSON
511
+ Parameters: {"id"=>"15"}
512
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 15 LIMIT 1
513
+ AREL (0.2ms) DELETE FROM "users" WHERE "users"."id" = 15
514
+ Completed 200 OK in 3ms
515
+
516
+
517
+ Started DELETE "/users/16.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
518
+ Processing by UsersController#destroy as JSON
519
+ Parameters: {"id"=>"16"}
520
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 16 LIMIT 1
521
+ AREL (0.2ms) DELETE FROM "users" WHERE "users"."id" = 16
522
+ Completed 200 OK in 2ms
523
+
524
+
525
+ Started GET "/notes.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
526
+ Processing by NotesController#index as JSON
527
+ Note Load (0.3ms) SELECT "notes".* FROM "notes"
528
+ Completed 200 OK in 4ms (Views: 1.4ms | ActiveRecord: 0.3ms)
529
+
530
+
531
+ Started DELETE "/notes/3.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
532
+ Processing by NotesController#destroy as JSON
533
+ Parameters: {"id"=>"3"}
534
+ Note Load (0.3ms) SELECT "notes".* FROM "notes" WHERE "notes"."id" = 3 LIMIT 1
535
+ AREL (0.2ms) DELETE FROM "notes" WHERE "notes"."id" = 3
536
+ Completed 200 OK in 3ms
537
+
538
+
539
+ Started DELETE "/notes/4.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
540
+ Processing by NotesController#destroy as JSON
541
+ Parameters: {"id"=>"4"}
542
+ Note Load (0.3ms) SELECT "notes".* FROM "notes" WHERE "notes"."id" = 4 LIMIT 1
543
+ AREL (0.2ms) DELETE FROM "notes" WHERE "notes"."id" = 4
544
+ Completed 200 OK in 2ms
545
+
546
+
547
+ Started POST "/users.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
548
+ Processing by UsersController#create as JSON
549
+ Parameters: {"user"=>{"name"=>"Fred", "rating"=>1}}
550
+ AREL (0.2ms) INSERT INTO "users" ("name", "rating") VALUES ('Fred', 1)
551
+ Completed 201 Created in 6ms (Views: 1.5ms | ActiveRecord: 0.0ms)
552
+
553
+
554
+ Started POST "/users.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
555
+ Processing by UsersController#create as JSON
556
+ Parameters: {"user"=>{"name"=>"Fred", "rating"=>2}}
557
+ AREL (0.2ms) INSERT INTO "users" ("name", "rating") VALUES ('Fred', 2)
558
+ Completed 201 Created in 5ms (Views: 1.5ms | ActiveRecord: 0.0ms)
559
+
560
+
561
+ Started POST "/users.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
562
+ Processing by UsersController#create as JSON
563
+ Parameters: {"user"=>{"name"=>"Betty", "rating"=>1}}
564
+ AREL (0.2ms) INSERT INTO "users" ("name", "rating") VALUES ('Betty', 1)
565
+ Completed 201 Created in 6ms (Views: 1.5ms | ActiveRecord: 0.0ms)
566
+
567
+
568
+ Started GET "/users.json?order=name+asc%2Crating+desc" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
569
+ Processing by UsersController#index as JSON
570
+ Parameters: {"order"=>"name asc,rating desc"}
571
+ User Load (0.3ms) SELECT "users".* FROM "users" ORDER BY name asc,rating desc
572
+ Completed 200 OK in 4ms (Views: 1.5ms | ActiveRecord: 0.3ms)
573
+
574
+
575
+ Started GET "/users.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
576
+ Processing by UsersController#index as JSON
577
+ User Load (0.2ms) SELECT "users".* FROM "users"
578
+ Completed 200 OK in 3ms (Views: 1.3ms | ActiveRecord: 0.2ms)
579
+
580
+
581
+ Started DELETE "/users/17.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
582
+ Processing by UsersController#destroy as JSON
583
+ Parameters: {"id"=>"17"}
584
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 17 LIMIT 1
585
+ AREL (0.2ms) DELETE FROM "users" WHERE "users"."id" = 17
586
+ Completed 200 OK in 3ms
587
+
588
+
589
+ Started DELETE "/users/18.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
590
+ Processing by UsersController#destroy as JSON
591
+ Parameters: {"id"=>"18"}
592
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 18 LIMIT 1
593
+ AREL (0.2ms) DELETE FROM "users" WHERE "users"."id" = 18
594
+ Completed 200 OK in 2ms
595
+
596
+
597
+ Started DELETE "/users/19.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
598
+ Processing by UsersController#destroy as JSON
599
+ Parameters: {"id"=>"19"}
600
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 19 LIMIT 1
601
+ AREL (0.2ms) DELETE FROM "users" WHERE "users"."id" = 19
602
+ Completed 200 OK in 2ms
603
+
604
+
605
+ Started GET "/notes.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
606
+ Processing by NotesController#index as JSON
607
+ Note Load (0.3ms) SELECT "notes".* FROM "notes"
608
+ Completed 200 OK in 3ms (Views: 1.1ms | ActiveRecord: 0.3ms)
609
+
610
+
611
+ Started POST "/users.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
612
+ Processing by UsersController#create as JSON
613
+ Parameters: {"user"=>{"name"=>"Fred", "rating"=>1}}
614
+ AREL (0.2ms) INSERT INTO "users" ("name", "rating") VALUES ('Fred', 1)
615
+ Completed 201 Created in 5ms (Views: 1.5ms | ActiveRecord: 0.0ms)
616
+
617
+
618
+ Started POST "/users.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
619
+ Processing by UsersController#create as JSON
620
+ Parameters: {"user"=>{"name"=>"Fred", "rating"=>2}}
621
+ AREL (0.2ms) INSERT INTO "users" ("name", "rating") VALUES ('Fred', 2)
622
+ Completed 201 Created in 5ms (Views: 1.5ms | ActiveRecord: 0.0ms)
623
+
624
+
625
+ Started POST "/users.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
626
+ Processing by UsersController#create as JSON
627
+ Parameters: {"user"=>{"name"=>"Betty", "rating"=>1}}
628
+ AREL (0.2ms) INSERT INTO "users" ("name", "rating") VALUES ('Betty', 1)
629
+ Completed 201 Created in 5ms (Views: 1.5ms | ActiveRecord: 0.0ms)
630
+
631
+
632
+ Started GET "/users.json?name=Fred&order=rating+desc" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
633
+ Processing by UsersController#index as JSON
634
+ Parameters: {"name"=>"Fred", "order"=>"rating desc"}
635
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."name" = 'Fred' ORDER BY rating desc
636
+ Completed 200 OK in 4ms (Views: 1.4ms | ActiveRecord: 0.3ms)
637
+
638
+
639
+ Started GET "/users.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
640
+ Processing by UsersController#index as JSON
641
+ User Load (0.3ms) SELECT "users".* FROM "users"
642
+ Completed 200 OK in 4ms (Views: 1.4ms | ActiveRecord: 0.3ms)
643
+
644
+
645
+ Started DELETE "/users/20.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
646
+ Processing by UsersController#destroy as JSON
647
+ Parameters: {"id"=>"20"}
648
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 20 LIMIT 1
649
+ AREL (0.2ms) DELETE FROM "users" WHERE "users"."id" = 20
650
+ Completed 200 OK in 2ms
651
+
652
+
653
+ Started DELETE "/users/21.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
654
+ Processing by UsersController#destroy as JSON
655
+ Parameters: {"id"=>"21"}
656
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 21 LIMIT 1
657
+ AREL (0.2ms) DELETE FROM "users" WHERE "users"."id" = 21
658
+ Completed 200 OK in 2ms
659
+
660
+
661
+ Started DELETE "/users/22.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
662
+ Processing by UsersController#destroy as JSON
663
+ Parameters: {"id"=>"22"}
664
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 22 LIMIT 1
665
+ AREL (0.2ms) DELETE FROM "users" WHERE "users"."id" = 22
666
+ Completed 200 OK in 3ms
667
+
668
+
669
+ Started GET "/notes.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
670
+ Processing by NotesController#index as JSON
671
+ Note Load (0.2ms) SELECT "notes".* FROM "notes"
672
+ Completed 200 OK in 3ms (Views: 1.0ms | ActiveRecord: 0.2ms)
673
+
674
+
675
+ Started POST "/users.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
676
+ Processing by UsersController#create as JSON
677
+ Parameters: {"user"=>{"name"=>"Fred"}}
678
+ AREL (0.2ms) INSERT INTO "users" ("name", "rating") VALUES ('Fred', NULL)
679
+ Completed 201 Created in 6ms (Views: 1.4ms | ActiveRecord: 0.0ms)
680
+
681
+
682
+ Started GET "/users/23.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
683
+ Processing by UsersController#show as JSON
684
+ Parameters: {"id"=>"23"}
685
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 23 LIMIT 1
686
+ Completed 200 OK in 3ms (Views: 1.1ms | ActiveRecord: 0.0ms)
687
+
688
+
689
+ Started GET "/users.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
690
+ Processing by UsersController#index as JSON
691
+ User Load (0.3ms) SELECT "users".* FROM "users"
692
+ Completed 200 OK in 3ms (Views: 1.2ms | ActiveRecord: 0.3ms)
693
+
694
+
695
+ Started DELETE "/users/23.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
696
+ Processing by UsersController#destroy as JSON
697
+ Parameters: {"id"=>"23"}
698
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 23 LIMIT 1
699
+ AREL (0.2ms) DELETE FROM "users" WHERE "users"."id" = 23
700
+ Completed 200 OK in 2ms
701
+
702
+
703
+ Started GET "/notes.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
704
+ Processing by NotesController#index as JSON
705
+ Note Load (0.2ms) SELECT "notes".* FROM "notes"
706
+ Completed 200 OK in 3ms (Views: 1.1ms | ActiveRecord: 0.2ms)
707
+
708
+
709
+ Started POST "/notes.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
710
+ Processing by NotesController#create as JSON
711
+ Parameters: {"note"=>{}}
712
+ AREL (0.2ms) INSERT INTO "notes" ("owner_id", "owner_type") VALUES (NULL, NULL)
713
+ Completed 201 Created in 6ms (Views: 1.6ms | ActiveRecord: 0.0ms)
714
+
715
+
716
+ Started GET "/users.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
717
+ Processing by UsersController#index as JSON
718
+ User Load (0.2ms) SELECT "users".* FROM "users"
719
+ Completed 200 OK in 3ms (Views: 1.1ms | ActiveRecord: 0.2ms)
720
+
721
+
722
+ Started GET "/notes.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
723
+ Processing by NotesController#index as JSON
724
+ Note Load (0.2ms) SELECT "notes".* FROM "notes"
725
+ Completed 200 OK in 3ms (Views: 1.2ms | ActiveRecord: 0.2ms)
726
+
727
+
728
+ Started DELETE "/notes/5.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
729
+ Processing by NotesController#destroy as JSON
730
+ Parameters: {"id"=>"5"}
731
+ Note Load (0.3ms) SELECT "notes".* FROM "notes" WHERE "notes"."id" = 5 LIMIT 1
732
+ AREL (0.2ms) DELETE FROM "notes" WHERE "notes"."id" = 5
733
+ Completed 200 OK in 2ms
734
+
735
+
736
+ Started POST "/users.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
737
+ Processing by UsersController#create as JSON
738
+ Parameters: {"user"=>{}}
739
+ AREL (0.2ms) INSERT INTO "users" ("name", "rating") VALUES (NULL, NULL)
740
+ Completed 201 Created in 6ms (Views: 1.5ms | ActiveRecord: 0.0ms)
741
+
742
+
743
+ Started POST "/notes.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
744
+ Processing by NotesController#create as JSON
745
+ Parameters: {"note"=>{"owner"=>{"user"=>{"id"=>24, "name"=>nil, "rating"=>nil}}}}
746
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 24 LIMIT 1
747
+ AREL (0.2ms) INSERT INTO "notes" ("owner_id", "owner_type") VALUES (24, NULL)
748
+ Completed 201 Created in 6ms (Views: 1.4ms | ActiveRecord: 0.0ms)
749
+
750
+
751
+ Started GET "/notes/6.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
752
+ Processing by NotesController#show as JSON
753
+ Parameters: {"id"=>"6"}
754
+ Note Load (0.3ms) SELECT "notes".* FROM "notes" WHERE "notes"."id" = 6 LIMIT 1
755
+ Completed 200 OK in 4ms (Views: 1.0ms | ActiveRecord: 0.0ms)
756
+
757
+
758
+ Started GET "/users/24.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
759
+ Processing by UsersController#show as JSON
760
+ Parameters: {"id"=>"24"}
761
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 24 LIMIT 1
762
+ Completed 200 OK in 3ms (Views: 1.0ms | ActiveRecord: 0.0ms)
763
+
764
+
765
+ Started GET "/users.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
766
+ Processing by UsersController#index as JSON
767
+ User Load (0.2ms) SELECT "users".* FROM "users"
768
+ Completed 200 OK in 3ms (Views: 1.2ms | ActiveRecord: 0.2ms)
769
+
770
+
771
+ Started DELETE "/users/24.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
772
+ Processing by UsersController#destroy as JSON
773
+ Parameters: {"id"=>"24"}
774
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 24 LIMIT 1
775
+ AREL (0.2ms) DELETE FROM "users" WHERE "users"."id" = 24
776
+ Completed 200 OK in 2ms
777
+
778
+
779
+ Started GET "/notes.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
780
+ Processing by NotesController#index as JSON
781
+ Note Load (0.3ms) SELECT "notes".* FROM "notes"
782
+ Completed 200 OK in 4ms (Views: 1.3ms | ActiveRecord: 0.3ms)
783
+
784
+
785
+ Started DELETE "/notes/6.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
786
+ Processing by NotesController#destroy as JSON
787
+ Parameters: {"id"=>"6"}
788
+ Note Load (0.3ms) SELECT "notes".* FROM "notes" WHERE "notes"."id" = 6 LIMIT 1
789
+ AREL (0.2ms) DELETE FROM "notes" WHERE "notes"."id" = 6
790
+ Completed 200 OK in 3ms
791
+
792
+
793
+ Started POST "/notes.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
794
+ Processing by NotesController#create as JSON
795
+ Parameters: {"note"=>{}}
796
+ AREL (0.2ms) INSERT INTO "notes" ("owner_id", "owner_type") VALUES (NULL, NULL)
797
+ Completed 201 Created in 5ms (Views: 1.6ms | ActiveRecord: 0.0ms)
798
+
799
+
800
+ Started POST "/notes.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
801
+ Processing by NotesController#create as JSON
802
+ Parameters: {"note"=>{}}
803
+ AREL (0.3ms) INSERT INTO "notes" ("owner_id", "owner_type") VALUES (NULL, NULL)
804
+ Completed 201 Created in 6ms (Views: 1.5ms | ActiveRecord: 0.0ms)
805
+
806
+
807
+ Started POST "/users.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
808
+ Processing by UsersController#create as JSON
809
+ Parameters: {"user"=>{"notes"=>[{"note"=>{"id"=>7, "owner_id"=>nil, "owner_type"=>nil}}, {"note"=>{"id"=>8, "owner_id"=>nil, "owner_type"=>nil}}]}}
810
+ Note Load (0.3ms) SELECT "notes".* FROM "notes" WHERE "notes"."id" = 7 LIMIT 1
811
+ Note Load (0.1ms) SELECT "notes".* FROM "notes" WHERE "notes"."id" = 8 LIMIT 1
812
+ AREL (0.2ms) INSERT INTO "users" ("name", "rating") VALUES (NULL, NULL)
813
+ AREL (0.1ms) UPDATE "notes" SET "owner_id" = 25 WHERE "notes"."id" = 7
814
+ AREL (0.0ms) UPDATE "notes" SET "owner_id" = 25 WHERE "notes"."id" = 8
815
+ Completed 201 Created in 9ms (Views: 1.4ms | ActiveRecord: 0.0ms)
816
+
817
+
818
+ Started GET "/users/25.json" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
819
+ Processing by UsersController#show as JSON
820
+ Parameters: {"id"=>"25"}
821
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 25 LIMIT 1
822
+ Completed 200 OK in 3ms (Views: 1.0ms | ActiveRecord: 0.0ms)
823
+
824
+
825
+ Started GET "/notes.json?owner_id=25" for 127.0.0.1 at 2012-05-08 00:39:24 +0200
826
+ Processing by NotesController#index as JSON
827
+ Parameters: {"owner_id"=>"25"}
828
+ Note Load (0.3ms) SELECT "notes".* FROM "notes" WHERE "notes"."owner_id" = 25
829
+ Completed 200 OK in 4ms (Views: 1.4ms | ActiveRecord: 0.3ms)