cadenero 0.0.2.a2 → 0.0.2.a3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -6,6 +6,7 @@ By [![Agiltec Logo](https://launchrock-assets.s3.amazonaws.com/logo-files/Gpujzv
6
6
  [![Code Climate](https://codeclimate.com/github/AgilTec/cadenero.png)](https://codeclimate.com/github/AgilTec/cadenero)
7
7
  [![Coverage Status](https://coveralls.io/repos/AgilTec/cadenero/badge.png?branch=master)](https://coveralls.io/r/AgilTec/cadenero?branch=master)
8
8
  [![Dependency Status](https://gemnasium.com/AgilTec/cadenero.png)](https://gemnasium.com/AgilTec/cadenero)
9
+ [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/AgilTec/cadenero/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
9
10
 
10
11
  Authentication Engine for Rails.API multitenant RESTful APIs based on Warden. It:
11
12
  * Is Racked based
@@ -20,63 +21,94 @@ Authentication Engine for Rails.API multitenant RESTful APIs based on Warden. It
20
21
 
21
22
  ### Installing **Cadenero**
22
23
  Generate first your Rails.API app as usual using:
24
+
23
25
  ```
24
- > rails-api new your_app --skip-test-unit
26
+ $ rails-api new your_app --skip-test-unit
25
27
  ```
28
+
26
29
  In the `Gemfile` add the following lines:
27
30
  ```ruby
28
- gem 'cadenero', '~> 0.0.2.a2'
29
- gem 'pg'
31
+ gem 'cadenero', '~> 0.0.2.a3'
32
+ gem 'pg'
30
33
  ```
34
+
31
35
  In the `config/database.yml` replace the `sqlite3` adapter for `postgresql` as follow:
36
+
32
37
  ```
33
- development:
34
- adapter: postgresql
35
- database: your_app_development
36
- min_messages: warning
38
+ development:
39
+ adapter: postgresql
40
+ database: your_app_development
41
+ min_messages: warning
37
42
 
38
- test:
39
- adapter: postgresql
40
- database: your_app_test
41
- min_messages: warning
43
+ test:
44
+ adapter: postgresql
45
+ database: your_app_test
46
+ min_messages: warning
42
47
  ```
43
48
 
44
49
  Then run bundle, create the databases and run the generator:
50
+
45
51
  ```
46
- > bundle install; rake db:create; rails-api g cadenero:install
52
+ $ bundle install; rake db:create; rails-api g cadenero:install
47
53
  ```
54
+
48
55
  Finally run the server:
56
+
49
57
  ```
50
- rails-api s
58
+ $ rails-api s
51
59
  ```
60
+
52
61
  Or much better for checking the multitenancy you can use [Pow](http://pow.cx/). To install or upgrade Pow, open a terminal and run this command:
62
+
53
63
  ```
54
- $ curl get.pow.cx | sh (View Source)
64
+ $ curl get.pow.cx | sh (View Source)
55
65
  ```
66
+
56
67
  To set up a Rack app, just symlink it into ~/.pow:
68
+
57
69
  ```
58
- $ cd ~/.pow
59
- $ ln -s /path/to/myapp
70
+ $ cd ~/.pow
71
+ $ ln -s /path/to/myapp
60
72
  ```
61
73
 
62
74
  Check that you can access the API using the default account `www` and user `testy@example.com` with password `changeme˜ or those defined for you when the generator was run. Ror the client you can use [cURL](http://curl.haxx.se/) or [RESTClient](http://restclient.net/)
63
75
 
76
+ You can create a new account as follows:
77
+
78
+ ```
79
+ $ curl -v -X POST http://www.cadenero.dev/v1/accounts -H 'Content-Type: application/json' -d '{"account": { "name": "Testy", "subdomain": "tested1", "owner_attributes": {"email": "testy2@example.com", "password": "changeme", "password_confirmation": "changeme"}}}'
80
+ ```
81
+ Or
82
+
83
+ ```
84
+ Request
85
+
86
+ POST http://www.cadenero.dev/v1/accounts
87
+
88
+ Content-Type: application/json
89
+
90
+ Body
91
+ {"account": { "name": "Testy", "subdomain": "test2", "owner_attributes": {"email": "testy2@example.com", "password": "changeme", "password_confirmation": "changeme"}}}
92
+ ```
93
+
64
94
  Have fun!
65
95
 
66
96
  ### Access Points
67
97
  **Cadenero** creates the following versioned routes for exposing the authentication RESTful API
68
98
 
69
99
  ```
70
- v1_root /v1(.:format) cadenero/v1/account/dashboard#index {:default=>:json}
71
- v1_sessions POST /v1/sessions(.:format) cadenero/v1/account/sessions#create {:default=>:json}
72
- DELETE /v1/sessions(.:format) cadenero/v1/account/sessions#delete {:default=>:json}
73
- v1_users POST /v1/users(.:format) cadenero/v1/account/users#create {:default=>:json}
74
- v1_accounts POST /v1/accounts(.:format) cadenero/v1/accounts#create {:default=>:json}
75
- root / cadenero/v1/account/dashboard#index {:default=>:json}
100
+ v1_root /v1(.:format) cadenero/v1/account/dashboard#index {:default=>:json}
101
+ v1_sessions POST /v1/sessions(.:format) cadenero/v1/account/sessions#create {:default=>:json}
102
+ DELETE /v1/sessions(.:format) cadenero/v1/account/sessions#delete {:default=>:json}
103
+ v1_users POST /v1/users(.:format) cadenero/v1/account/users#create {:default=>:json}
104
+ v1_accounts POST /v1/accounts(.:format) cadenero/v1/accounts#create {:default=>:json}
105
+ root / cadenero/v1/account/dashboard#index {:default=>:json}
76
106
  ```
77
- You can check then running:
107
+
108
+ You can check them running:
109
+
78
110
  ```
79
- rake routes
111
+ rake routes
80
112
  ```
81
113
 
82
114
  ### The Cadenero Task List
@@ -1,11 +1,14 @@
1
1
  require_dependency "cadenero/application_controller"
2
-
2
+ # Dashboard Controller that can be overrided for be the root access point of your API app
3
3
  module Cadenero
4
+ #name space for this API version
4
5
  class V1::Account::DashboardController < Cadenero::ApplicationController
6
+ # Protecting the site
5
7
  before_filter :authenticate_user!
6
8
 
9
+ # Default action
7
10
  def index
8
- render json: {message: "Welcome #{current_user.email}"}, status: 201
11
+ render json: {message: "Welcome #{current_user.email}"}, status: :ok # Welcome message for current_user
9
12
  end
10
13
  end
11
14
  end
@@ -1,26 +1,25 @@
1
1
  require_dependency "cadenero/application_controller"
2
-
2
+ # COntroller for managing sessions for the API if you are using the :password Strategy
3
3
  module Cadenero::V1
4
4
  class Account::SessionsController < Cadenero::ApplicationController
5
+ # create the session for the user using the password strategy and returning the user JSON
5
6
  def create
6
- Rails.logger.info "params: #{params}"
7
7
  if env['warden'].authenticate(:password, :scope => :user)
8
- render json: current_user, status: 201
8
+ #return the user JSON on success
9
+ render json: current_user, status: :created
9
10
  else
10
- render json: {errors: {user:["Invalid email or password"]}}, status: 422
11
+ #return error mesage in a JSON on error
12
+ render json: {errors: {user:["Invalid email or password"]}}, status: :unprocessable_entity
11
13
  end
12
14
  end
15
+
13
16
  def delete
14
17
  user = Cadenero::User.find_by_id(params[:id])
15
- Rails.logger.info "id: #{params[:id]}"
16
- Rails.logger.info "user: #{user.to_json}"
17
- Rails.logger.info "current_user.id: #{current_user}"
18
- Rails.logger.info "user_signed_in?: #{user_signed_in?}"
19
- if user_signed_in?
18
+ if user_signed_in?
20
19
  env['warden'].logout(:user)
21
- render json: {message: "Successful logout"}, status: 201
20
+ render json: {message: "Successful logout"}, status: :ok
22
21
  else
23
- render json: {message: "Unsuccessful logout user with id"}, status: 401
22
+ render json: {message: "Unsuccessful logout user with id"}, status: :forbidden
24
23
  end
25
24
  end
26
25
  end
@@ -20,7 +20,7 @@ module Cadenero
20
20
  account = Cadenero::V1::Account.where(subdomain: request.subdomain).first
21
21
  @user = account.users.create(params[:user])
22
22
  force_authentication!(@user)
23
- render json: @user, status: 201
23
+ render json: @user, status: :created
24
24
  end
25
25
  end
26
26
  end
@@ -10,16 +10,15 @@ module Cadenero
10
10
  def create
11
11
  @account = Cadenero::V1::Account.create_with_owner(params[:account])
12
12
  if @account.valid?
13
- force_authentication!(@account.owner)
14
13
  @account.create_schema
15
14
  @account.ensure_authentication_token!
16
- data = {
17
- account_id: @account.id,
18
- auth_token: @account.authentication_token
19
- }
20
- render json: data, status: 201
15
+ force_authentication!(@account.owner)
16
+ render json: @account, status: :created
21
17
  else
22
- render json: {errors: @account.errors}, status: 422
18
+ @data = {
19
+ errors: @account.errors
20
+ }
21
+ render json: @data, status: :unprocessable_entity
23
22
  end
24
23
  end
25
24
  end
@@ -2,7 +2,13 @@ module Cadenero
2
2
  class User < ActiveRecord::Base
3
3
  attr_accessible :email, :password, :password_confirmation
4
4
  has_secure_password
5
- has_many :members, :class_name => "Cadenero::Member"
6
- has_many :accounts, :through => :members
5
+ has_many :accounts, class_name: "Cadenero::V1::Account", foreign_key: "owner_id"
6
+ has_many :members, class_name: "Cadenero::Member"
7
+ has_many :memberships, through: :members, source: :account
8
+
9
+ def auth_token
10
+ accounts[0].authentication_token if accounts[0]
11
+ end
12
+
7
13
  end
8
14
  end
@@ -2,11 +2,12 @@ module Cadenero::V1
2
2
  class Account < ActiveRecord::Base
3
3
  belongs_to :owner, :class_name => "Cadenero::User"
4
4
  has_many :members, :class_name => "Cadenero::Member"
5
- has_many :users, :through => :members
5
+ has_many :users, :through => :members, :class_name => "Cadenero::User"
6
6
 
7
7
  accepts_nested_attributes_for :owner
8
8
  attr_accessible :name, :subdomain, :owner_attributes, :owner
9
9
  validates :subdomain, :presence => true, :uniqueness => true
10
+ validates :owner, :presence => true
10
11
 
11
12
  # Creates an accout and assign the provided [Cadenero::User] as owner to the account
12
13
  # @param [Hash] params list
@@ -29,32 +30,44 @@ module Cadenero::V1
29
30
  Apartment::Database.create(subdomain)
30
31
  end
31
32
 
33
+ # Generate authentication token unless already exists.
34
+ def ensure_authentication_token
35
+ reset_authentication_token if authentication_token.blank?
36
+ end
37
+
32
38
  # Generate authentication token unless already exists and save the record.
33
39
  def ensure_authentication_token!
34
40
  reset_authentication_token! if authentication_token.blank?
35
41
  end
36
42
 
37
43
  # Generate new authentication token (a.k.a. "single access token").
38
- def reset_authentication_token!
44
+ def reset_authentication_token
39
45
  self.authentication_token = self.class.authentication_token
40
46
  end
41
47
 
42
- # Generate a token checking if one does not already exist in the database.
43
- # @return the authentication_token
44
- def authentication_token
45
- generate_token(:authentication_token)
48
+ # Generate new authentication token and save the record.
49
+ def reset_authentication_token!
50
+ reset_authentication_token
51
+ save(:validate => false)
46
52
  end
47
53
 
48
- # Generate a token by looping and ensuring does not already exist.
49
- # @params [String] column is the name of the column that has the authentication token
50
- # @return a unique generated authentication_token
51
- def generate_token(column)
52
- loop do
53
- token = SecureRandom.base64(15).tr('+/=lIO0', 'pqrsxyz')
54
- break token unless Account.where({ column => token }).first
54
+ class << self
55
+ # Generate a token checking if one does not already exist in the database.
56
+ def authentication_token
57
+ generate_token(:authentication_token)
55
58
  end
56
- end
57
59
 
60
+ protected
61
+ # Generate a token by looping and ensuring does not already exist.
62
+ # @params [String] column is the name of the column that has the authentication token
63
+ # @return a unique generated authentication_token
64
+ def generate_token(column)
65
+ loop do
66
+ token = SecureRandom.base64(15).tr('+/=lIO0', 'pqrsxyz')
67
+ break token unless Account.where({ column => token }).first
68
+ end
69
+ end
70
+ end
58
71
 
59
72
  end
60
73
  end
@@ -1,9 +1,8 @@
1
1
  module Cadenero
2
2
  class AccountSerializer < ActiveModel::Serializer
3
3
  embed :ids
4
- attributes :id, :name, :subdomain
5
- has_one :owner, :class_name => "Cadenero::User"
6
- has_many :members, :class_name => "Cadenero::Member"
7
- has_many :users, :through => :members
4
+ attributes :id, :name, :subdomain, :authentication_token
5
+ has_one :owner
6
+ has_many :users
8
7
  end
9
8
  end
@@ -1,9 +1,9 @@
1
1
  module Cadenero
2
2
  class UserSerializer < ActiveModel::Serializer
3
3
  embed :ids
4
- attributes :id, :email
5
- has_many :members, :class_name => "Cadenero::Member"
6
- has_many :accounts, :through => :members
4
+ attributes :id, :email, :auth_token
5
+ has_many :accounts
6
+ has_many :memberships
7
7
 
8
8
  end
9
9
  end
@@ -1,3 +1,3 @@
1
1
  module Cadenero
2
- VERSION = "0.0.2.a2"
2
+ VERSION = "0.0.2.a3"
3
3
  end
@@ -2,24 +2,40 @@ require 'spec_helper'
2
2
 
3
3
  module Cadenero
4
4
  describe V1::AccountsController do
5
- context "creates the account's schema" do
5
+ let!(:account) { stub_model(Cadenero::V1::Account, id: 1001, authentication_token: "dsdaefer412add") }
6
+
7
+ before do
8
+ Cadenero::V1::Account.should_receive(:create_with_owner).and_return(account)
9
+ controller.stub(:force_authentication!)
10
+ end
6
11
 
7
- let!(:account) { stub_model(Cadenero::V1::Account) }
8
-
12
+ context "creates the account's schema" do
9
13
  before do
10
- Cadenero::V1::Account.should_receive(:create_with_owner).and_return(account)
11
14
  account.stub :valid? => true
12
- controller.stub(:force_authentication!)
13
- end
14
-
15
+ end
15
16
  it "should create a schema and ensure a token is returned for the account on successful creation" do
16
17
  account.should_receive(:create_schema)
17
18
  account.should_receive(:ensure_authentication_token!)
18
- post :create, account: { name: "First Account", subdomain: "first" }, use_route: :cadenero
19
- expect(account.authentication_token).not_to eq nil
20
- end
19
+ post :create, format: :json, account: { name: "First Account", subdomain: "first" }, use_route: :cadenero
20
+ expect(response.status).to eq(201)
21
+ expect(assigns(:account)).to eq(account)
22
+ expect(assigns(:account)[:authentication_token]).to eq(account.authentication_token)
23
+ end
24
+ end
21
25
 
22
- end
26
+ context "when the message fails to save" do
27
+ before do
28
+ account.stub(:save).and_return(false)
29
+ account.stub :valid? => false
30
+ end
31
+ it "assigns @data to error" do
32
+ post :create, format: :json, account: {name: "First Account" }, use_route: :cadenero
33
+ expect(response.status).to eq(422)
34
+ expect(assigns(:data).to_json).to eq({
35
+ errors: account.errors
36
+ }.to_json)
37
+ end
38
+ end
23
39
  end
24
40
  end
25
41
 
@@ -1,446 +1,83 @@
1
1
  Connecting to database specified by database.yml
2
2
 
3
3
 
4
- Started GET "/" for 127.0.0.1 at 2013-06-27 22:27:20 -0500
5
- Processing by Cadenero::V1::Account::DashboardController#index as HTML
6
- Parameters: {"default"=>:json}
7
- env['warden'].authenticated?(:user): false
8
- Filter chain halted as :authenticate_user! rendered or redirected
9
- Completed 422 Unprocessable Entity in 7ms (Views: 0.5ms | ActiveRecord: 0.0ms)
10
-
11
-
12
- Started POST "/v1/sessions" for 127.0.0.1 at 2013-06-27 22:27:54 -0500
13
- Processing by Cadenero::V1::Account::SessionsController#create as HTML
14
- Parameters: {"user"=>{"email"=>"testy3@example.com", "password"=>"[FILTERED]"}, "default"=>:json}
15
- params: {"user"=>{"email"=>"testy3@example.com", "password"=>"changeme"}, "default"=>:json, "controller"=>"cadenero/v1/account/sessions", "action"=>"create"}
16
- valid? subdomain: ["test3"]
17
- json_params: {}
18
- valid? json_params: {"user"=>{"email"=>"testy3@example.com", "password"=>"changeme"}}
19
- json_params: {}
20
- Completed 500 Internal Server Error in 1ms
21
-
22
- TypeError (can't convert nil into String):
23
- /Users/manuelevidaurrea/.rbenv/versions/1.9.3-p429/lib/ruby/1.9.1/json/common.rb:148:in `initialize'
24
- /Users/manuelevidaurrea/.rbenv/versions/1.9.3-p429/lib/ruby/1.9.1/json/common.rb:148:in `new'
25
- /Users/manuelevidaurrea/.rbenv/versions/1.9.3-p429/lib/ruby/1.9.1/json/common.rb:148:in `parse'
26
- /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/config/initializers/warden/strategies/password.rb:12:in `json_params'
27
- /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/config/initializers/warden/strategies/password.rb:19:in `valid?'
28
- warden (1.2.1) lib/warden/proxy.rb:351:in `block in _run_strategies_for'
29
- warden (1.2.1) lib/warden/proxy.rb:349:in `each'
30
- warden (1.2.1) lib/warden/proxy.rb:349:in `_run_strategies_for'
31
- warden (1.2.1) lib/warden/proxy.rb:319:in `_perform_authentication'
32
- warden (1.2.1) lib/warden/proxy.rb:104:in `authenticate'
33
- /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/app/controllers/cadenero/v1/account/sessions_controller.rb:7:in `create'
34
- actionpack (3.2.13) lib/abstract_controller/base.rb:167:in `process_action'
35
- actionpack (3.2.13) lib/action_controller/metal/rendering.rb:10:in `process_action'
36
- actionpack (3.2.13) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
37
- activesupport (3.2.13) lib/active_support/callbacks.rb:403:in `_run__1930556790785450317__process_action__3783338458040428985__callbacks'
38
- activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'
39
- activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
40
- activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'
41
- actionpack (3.2.13) lib/abstract_controller/callbacks.rb:17:in `process_action'
42
- actionpack (3.2.13) lib/action_controller/metal/rescue.rb:29:in `process_action'
43
- actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
44
- activesupport (3.2.13) lib/active_support/notifications.rb:123:in `block in instrument'
45
- activesupport (3.2.13) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
46
- activesupport (3.2.13) lib/active_support/notifications.rb:123:in `instrument'
47
- actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
48
- activerecord (3.2.13) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
49
- actionpack (3.2.13) lib/abstract_controller/base.rb:121:in `process'
50
- actionpack (3.2.13) lib/abstract_controller/rendering.rb:45:in `process'
51
- actionpack (3.2.13) lib/action_controller/metal.rb:203:in `dispatch'
52
- actionpack (3.2.13) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
53
- actionpack (3.2.13) lib/action_controller/metal.rb:246:in `block in action'
54
- actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:in `call'
55
- actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
56
- actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:36:in `call'
57
- actionpack (3.2.13) lib/action_dispatch/routing/mapper.rb:42:in `call'
58
- journey (1.0.4) lib/journey/router.rb:68:in `block in call'
59
- journey (1.0.4) lib/journey/router.rb:56:in `each'
60
- journey (1.0.4) lib/journey/router.rb:56:in `call'
61
- actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:612:in `call'
62
- rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
63
- rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
64
- actionpack (3.2.13) lib/action_dispatch/middleware/cookies.rb:341:in `call'
65
- warden (1.2.1) lib/warden/manager.rb:31:in `call'
66
- railties (3.2.13) lib/rails/engine.rb:479:in `call'
67
- railties (3.2.13) lib/rails/railtie/configurable.rb:30:in `method_missing'
68
- journey (1.0.4) lib/journey/router.rb:68:in `block in call'
69
- journey (1.0.4) lib/journey/router.rb:56:in `each'
70
- journey (1.0.4) lib/journey/router.rb:56:in `call'
71
- actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:612:in `call'
72
- warden (1.2.1) lib/warden/manager.rb:35:in `block in call'
73
- warden (1.2.1) lib/warden/manager.rb:34:in `catch'
74
- warden (1.2.1) lib/warden/manager.rb:34:in `call'
75
- apartment (0.21.1) lib/apartment/elevators/generic.rb:19:in `call'
76
- apartment (0.21.1) lib/apartment/reloader.rb:19:in `call'
77
- rack (1.4.5) lib/rack/etag.rb:23:in `call'
78
- rack (1.4.5) lib/rack/conditionalget.rb:35:in `call'
79
- actionpack (3.2.13) lib/action_dispatch/middleware/head.rb:14:in `call'
80
- actionpack (3.2.13) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
81
- activerecord (3.2.13) lib/active_record/query_cache.rb:64:in `call'
82
- activerecord (3.2.13) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
83
- actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
84
- activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `_run__1957069703945298240__call__3451355860951162812__callbacks'
85
- activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'
86
- activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
87
- activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'
88
- actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
89
- actionpack (3.2.13) lib/action_dispatch/middleware/reloader.rb:65:in `call'
90
- actionpack (3.2.13) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
91
- actionpack (3.2.13) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
92
- actionpack (3.2.13) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
93
- railties (3.2.13) lib/rails/rack/logger.rb:32:in `call_app'
94
- railties (3.2.13) lib/rails/rack/logger.rb:16:in `block in call'
95
- activesupport (3.2.13) lib/active_support/tagged_logging.rb:22:in `tagged'
96
- railties (3.2.13) lib/rails/rack/logger.rb:16:in `call'
97
- actionpack (3.2.13) lib/action_dispatch/middleware/request_id.rb:22:in `call'
98
- rack (1.4.5) lib/rack/runtime.rb:17:in `call'
99
- activesupport (3.2.13) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
100
- rack (1.4.5) lib/rack/lock.rb:15:in `call'
101
- actionpack (3.2.13) lib/action_dispatch/middleware/static.rb:63:in `call'
102
- railties (3.2.13) lib/rails/engine.rb:479:in `call'
103
- railties (3.2.13) lib/rails/application.rb:223:in `call'
104
- railties (3.2.13) lib/rails/railtie/configurable.rb:30:in `method_missing'
105
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:147:in `handle'
106
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:99:in `rescue in block (2 levels) in start'
107
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:96:in `block (2 levels) in start'
108
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:86:in `each'
109
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:86:in `block in start'
110
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:66:in `loop'
111
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:66:in `start'
112
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:13:in `run'
113
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/bin/nack_worker:4:in `<main>'
114
-
115
-
116
- Rendered /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_trace.erb (2.3ms)
117
- Rendered /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.7ms)
118
- Rendered /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (117.3ms)
119
- Connecting to database specified by database.yml
120
-
121
-
122
- Started GET "/" for 127.0.0.1 at 2013-06-27 22:30:27 -0500
123
- Processing by Cadenero::V1::Account::DashboardController#index as HTML
124
- Parameters: {"default"=>:json}
125
- env['warden'].authenticated?(:user): false
126
- Filter chain halted as :authenticate_user! rendered or redirected
127
- Completed 422 Unprocessable Entity in 6ms (Views: 0.3ms | ActiveRecord: 0.0ms)
128
-
129
-
130
- Started POST "/v1/sessions" for 127.0.0.1 at 2013-06-27 22:30:33 -0500
131
- Processing by Cadenero::V1::Account::SessionsController#create as HTML
132
- Parameters: {"user"=>{"email"=>"testy3@example.com", "password"=>"[FILTERED]"}, "default"=>:json}
133
- params: {"user"=>{"email"=>"testy3@example.com", "password"=>"changeme"}, "default"=>:json, "controller"=>"cadenero/v1/account/sessions", "action"=>"create"}
134
- valid? subdomain: ["test3"]
135
- json_params: {}
136
- params.empty?: true
137
- env['rack.input'].gets: {"user": {"email": "testy3@example.com", "password": "changeme"}}
138
- Completed 500 Internal Server Error in 1ms
139
-
140
- TypeError (can't convert nil into String):
141
- /Users/manuelevidaurrea/.rbenv/versions/1.9.3-p429/lib/ruby/1.9.1/json/common.rb:148:in `initialize'
142
- /Users/manuelevidaurrea/.rbenv/versions/1.9.3-p429/lib/ruby/1.9.1/json/common.rb:148:in `new'
143
- /Users/manuelevidaurrea/.rbenv/versions/1.9.3-p429/lib/ruby/1.9.1/json/common.rb:148:in `parse'
144
- /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/config/initializers/warden/strategies/password.rb:13:in `json_params'
145
- /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/config/initializers/warden/strategies/password.rb:19:in `valid?'
146
- warden (1.2.1) lib/warden/proxy.rb:351:in `block in _run_strategies_for'
147
- warden (1.2.1) lib/warden/proxy.rb:349:in `each'
148
- warden (1.2.1) lib/warden/proxy.rb:349:in `_run_strategies_for'
149
- warden (1.2.1) lib/warden/proxy.rb:319:in `_perform_authentication'
150
- warden (1.2.1) lib/warden/proxy.rb:104:in `authenticate'
151
- /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/app/controllers/cadenero/v1/account/sessions_controller.rb:7:in `create'
152
- actionpack (3.2.13) lib/abstract_controller/base.rb:167:in `process_action'
153
- actionpack (3.2.13) lib/action_controller/metal/rendering.rb:10:in `process_action'
154
- actionpack (3.2.13) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
155
- activesupport (3.2.13) lib/active_support/callbacks.rb:403:in `_run__718181710820714038__process_action__4579058258704994523__callbacks'
156
- activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'
157
- activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
158
- activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'
159
- actionpack (3.2.13) lib/abstract_controller/callbacks.rb:17:in `process_action'
160
- actionpack (3.2.13) lib/action_controller/metal/rescue.rb:29:in `process_action'
161
- actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
162
- activesupport (3.2.13) lib/active_support/notifications.rb:123:in `block in instrument'
163
- activesupport (3.2.13) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
164
- activesupport (3.2.13) lib/active_support/notifications.rb:123:in `instrument'
165
- actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
166
- activerecord (3.2.13) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
167
- actionpack (3.2.13) lib/abstract_controller/base.rb:121:in `process'
168
- actionpack (3.2.13) lib/abstract_controller/rendering.rb:45:in `process'
169
- actionpack (3.2.13) lib/action_controller/metal.rb:203:in `dispatch'
170
- actionpack (3.2.13) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
171
- actionpack (3.2.13) lib/action_controller/metal.rb:246:in `block in action'
172
- actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:in `call'
173
- actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
174
- actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:36:in `call'
175
- actionpack (3.2.13) lib/action_dispatch/routing/mapper.rb:42:in `call'
176
- journey (1.0.4) lib/journey/router.rb:68:in `block in call'
177
- journey (1.0.4) lib/journey/router.rb:56:in `each'
178
- journey (1.0.4) lib/journey/router.rb:56:in `call'
179
- actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:612:in `call'
180
- rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
181
- rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
182
- actionpack (3.2.13) lib/action_dispatch/middleware/cookies.rb:341:in `call'
183
- warden (1.2.1) lib/warden/manager.rb:31:in `call'
184
- railties (3.2.13) lib/rails/engine.rb:479:in `call'
185
- railties (3.2.13) lib/rails/railtie/configurable.rb:30:in `method_missing'
186
- journey (1.0.4) lib/journey/router.rb:68:in `block in call'
187
- journey (1.0.4) lib/journey/router.rb:56:in `each'
188
- journey (1.0.4) lib/journey/router.rb:56:in `call'
189
- actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:612:in `call'
190
- warden (1.2.1) lib/warden/manager.rb:35:in `block in call'
191
- warden (1.2.1) lib/warden/manager.rb:34:in `catch'
192
- warden (1.2.1) lib/warden/manager.rb:34:in `call'
193
- apartment (0.21.1) lib/apartment/elevators/generic.rb:19:in `call'
194
- apartment (0.21.1) lib/apartment/reloader.rb:19:in `call'
195
- rack (1.4.5) lib/rack/etag.rb:23:in `call'
196
- rack (1.4.5) lib/rack/conditionalget.rb:35:in `call'
197
- actionpack (3.2.13) lib/action_dispatch/middleware/head.rb:14:in `call'
198
- actionpack (3.2.13) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
199
- activerecord (3.2.13) lib/active_record/query_cache.rb:64:in `call'
200
- activerecord (3.2.13) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
201
- actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
202
- activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `_run__2774346958201521148__call__1414120328066642717__callbacks'
203
- activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'
204
- activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
205
- activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'
206
- actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
207
- actionpack (3.2.13) lib/action_dispatch/middleware/reloader.rb:65:in `call'
208
- actionpack (3.2.13) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
209
- actionpack (3.2.13) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
210
- actionpack (3.2.13) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
211
- railties (3.2.13) lib/rails/rack/logger.rb:32:in `call_app'
212
- railties (3.2.13) lib/rails/rack/logger.rb:16:in `block in call'
213
- activesupport (3.2.13) lib/active_support/tagged_logging.rb:22:in `tagged'
214
- railties (3.2.13) lib/rails/rack/logger.rb:16:in `call'
215
- actionpack (3.2.13) lib/action_dispatch/middleware/request_id.rb:22:in `call'
216
- rack (1.4.5) lib/rack/runtime.rb:17:in `call'
217
- activesupport (3.2.13) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
218
- rack (1.4.5) lib/rack/lock.rb:15:in `call'
219
- actionpack (3.2.13) lib/action_dispatch/middleware/static.rb:63:in `call'
220
- railties (3.2.13) lib/rails/engine.rb:479:in `call'
221
- railties (3.2.13) lib/rails/application.rb:223:in `call'
222
- railties (3.2.13) lib/rails/railtie/configurable.rb:30:in `method_missing'
223
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:147:in `handle'
224
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:99:in `rescue in block (2 levels) in start'
225
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:96:in `block (2 levels) in start'
226
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:86:in `each'
227
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:86:in `block in start'
228
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:66:in `loop'
229
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:66:in `start'
230
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:13:in `run'
231
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/bin/nack_worker:4:in `<main>'
232
-
233
-
234
- Rendered /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.9ms)
235
- Rendered /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.5ms)
236
- Rendered /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (160.4ms)
237
- Connecting to database specified by database.yml
238
-
239
-
240
- Started GET "/" for 127.0.0.1 at 2013-06-27 22:32:51 -0500
241
- Processing by Cadenero::V1::Account::DashboardController#index as HTML
242
- Parameters: {"default"=>:json}
243
- env['warden'].authenticated?(:user): false
244
- Filter chain halted as :authenticate_user! rendered or redirected
245
- Completed 422 Unprocessable Entity in 5ms (Views: 0.3ms | ActiveRecord: 0.0ms)
246
-
247
-
248
- Started POST "/v1/sessions" for 127.0.0.1 at 2013-06-27 22:33:38 -0500
249
- Processing by Cadenero::V1::Account::SessionsController#create as HTML
250
- Parameters: {"user"=>{"email"=>"testy3@example.com", "password"=>"[FILTERED]"}, "default"=>:json}
251
- params: {"user"=>{"email"=>"testy3@example.com", "password"=>"changeme"}, "default"=>:json, "controller"=>"cadenero/v1/account/sessions", "action"=>"create"}
252
- valid? subdomain: ["test3"]
253
- json_params: {}
254
- params.empty?: true
255
- env['rack.input'].gets: {"user": {"email": "testy3@example.com", "password": "changeme"}}
256
- Completed 500 Internal Server Error in 1ms
257
-
258
- TypeError (can't convert nil into String):
259
- /Users/manuelevidaurrea/.rbenv/versions/1.9.3-p429/lib/ruby/1.9.1/json/common.rb:148:in `initialize'
260
- /Users/manuelevidaurrea/.rbenv/versions/1.9.3-p429/lib/ruby/1.9.1/json/common.rb:148:in `new'
4
+ Started POST "/v1/accounts" for 127.0.0.1 at 2013-06-28 21:05:24 -0500
5
+ Processing by Cadenero::V1::AccountsController#create as JSON
6
+ Parameters: {"{\"account\": { \"name\": \"Testy\", \"subdomain\": \"tested\", \"owner_attributes\": {\"email\": \"testy2@example.com\", \"password\": \"changeme\", \"password_confirmation\": \"changeme\"}}}"=>"[FILTERED]", "default"=>:json}
7
+ AccountsController params[:account]:
8
+  (0.1ms) BEGIN
9
+ Cadenero::V1::Account Exists (0.7ms) SELECT 1 AS one FROM "public"."cadenero_accounts" WHERE "public"."cadenero_accounts"."subdomain" IS NULL LIMIT 1
10
+  (0.1ms) ROLLBACK
11
+ CACHE (0.0ms) SELECT 1 AS one FROM "public"."cadenero_accounts" WHERE "public"."cadenero_accounts"."subdomain" IS NULL LIMIT 1
12
+ Completed 422 Unprocessable Entity in 206ms (Views: 0.3ms | ActiveRecord: 53.9ms)
13
+
14
+
15
+ Started POST "/v1/accounts" for 127.0.0.1 at 2013-06-28 21:07:22 -0500
16
+ Processing by Cadenero::V1::AccountsController#create as JSON
17
+ Parameters: {"{account: { name: \"Testy\", subdomain: \"tested\", owner_attributes: {email: \"testy2@example.com\", password: \"changeme\", password_confirmation: \"changeme\"}}}"=>"[FILTERED]", "default"=>:json}
18
+ AccountsController params[:account]:
19
+  (0.9ms) BEGIN
20
+ Cadenero::V1::Account Exists (0.2ms) SELECT 1 AS one FROM "public"."cadenero_accounts" WHERE "public"."cadenero_accounts"."subdomain" IS NULL LIMIT 1
21
+  (0.1ms) ROLLBACK
22
+ CACHE (0.0ms) SELECT 1 AS one FROM "public"."cadenero_accounts" WHERE "public"."cadenero_accounts"."subdomain" IS NULL LIMIT 1
23
+ Completed 422 Unprocessable Entity in 23ms (Views: 0.3ms | ActiveRecord: 3.4ms)
24
+
25
+
26
+ Started POST "/v1/accounts" for 127.0.0.1 at 2013-06-28 21:08:47 -0500
27
+ Processing by Cadenero::V1::AccountsController#create as HTML
28
+ Parameters: {"account"=>{"name"=>"Testy", "subdomain"=>"test2", "owner_attributes"=>{"email"=>"testy2@example.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}}, "default"=>:json}
29
+ AccountsController params[:account]: {"name"=>"Testy", "subdomain"=>"test2", "owner_attributes"=>{"email"=>"testy2@example.com", "password"=>"changeme", "password_confirmation"=>"changeme"}}
30
+  (0.2ms) BEGIN
31
+ Cadenero::V1::Account Exists (8.8ms) SELECT 1 AS one FROM "public"."cadenero_accounts" WHERE "public"."cadenero_accounts"."subdomain" = 'test2' LIMIT 1
32
+ SQL (30.8ms) INSERT INTO "public"."cadenero_users" ("created_at", "email", "password_digest", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", Sat, 29 Jun 2013 02:08:48 UTC +00:00], ["email", "testy2@example.com"], ["password_digest", "$2a$10$wgSMh7Xkg5G/Gu4dCFEhz.JpCjRTfmtZTDiOle.UEVZQojQQBMOpy"], ["updated_at", Sat, 29 Jun 2013 02:08:48 UTC +00:00]]
33
+ SQL (17.7ms) INSERT INTO "public"."cadenero_accounts" ("authentication_token", "created_at", "name", "owner_id", "subdomain", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["authentication_token", nil], ["created_at", Sat, 29 Jun 2013 02:08:48 UTC +00:00], ["name", "Testy"], ["owner_id", 4], ["subdomain", "test2"], ["updated_at", Sat, 29 Jun 2013 02:08:48 UTC +00:00]]
34
+ Cadenero::V1::Account Load (0.5ms) SELECT "public"."cadenero_accounts".* FROM "public"."cadenero_accounts" WHERE "public"."cadenero_accounts"."authentication_token" = 'dggwaxfQZ2QupEyd2qcs' LIMIT 1
35
+  (0.5ms) UPDATE "public"."cadenero_accounts" SET "name" = 'Testy', "subdomain" = 'test2', "owner_id" = 4, "created_at" = '2013-06-29 02:08:48.424365', "updated_at" = '2013-06-29 02:08:48.424365' WHERE "public"."cadenero_accounts"."id" = 4
36
+  (14.2ms) COMMIT
37
+  (1.5ms) BEGIN
38
+ SQL (3.6ms) INSERT INTO "public"."cadenero_members" ("account_id", "created_at", "updated_at", "user_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["account_id", 4], ["created_at", Sat, 29 Jun 2013 02:08:48 UTC +00:00], ["updated_at", Sat, 29 Jun 2013 02:08:48 UTC +00:00], ["user_id", 4]]
39
+  (21.9ms) COMMIT
40
+ Cadenero::V1::Account Exists (0.5ms) SELECT 1 AS one FROM "public"."cadenero_accounts" WHERE ("public"."cadenero_accounts"."subdomain" = 'test2' AND "public"."cadenero_accounts"."id" != 4) LIMIT 1
41
+  (22.3ms) CREATE SCHEMA "test2"
42
+  (75.3ms) CREATE TABLE "cadenero_accounts" ("id" serial primary key, "name" character varying(255), "subdomain" character varying(255), "authentication_token" character varying(255), "owner_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
43
+  (16.7ms) CREATE INDEX "index_cadenero_accounts_on_authentication_token" ON "cadenero_accounts" ("authentication_token")
44
+  (41.3ms) CREATE INDEX "index_cadenero_accounts_on_owner_id" ON "cadenero_accounts" ("owner_id")
45
+  (4.8ms) CREATE TABLE "cadenero_members" ("id" serial primary key, "account_id" integer, "user_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
46
+  (7.8ms) CREATE INDEX "index_cadenero_members_on_account_id" ON "cadenero_members" ("account_id")
47
+  (24.8ms) CREATE INDEX "index_cadenero_members_on_user_id" ON "cadenero_members" ("user_id")
48
+  (7.4ms) CREATE TABLE "cadenero_users" ("id" serial primary key, "email" character varying(255), "password_digest" character varying(255), "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
49
+  (5.6ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)
50
+  (3.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
51
+  (0.4ms) SELECT version FROM "schema_migrations"
52
+  (10.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20130612073709')
53
+ Cadenero::V1::Account Load (0.5ms) SELECT "public"."cadenero_accounts".* FROM "public"."cadenero_accounts" WHERE "public"."cadenero_accounts"."authentication_token" = 'yhJzssan6ExxfuGDPeuq' LIMIT 1
54
+  (0.1ms) BEGIN
55
+  (0.1ms) COMMIT
56
+  (0.1ms) BEGIN
57
+ SQL (1.1ms) INSERT INTO "public"."cadenero_members" ("account_id", "created_at", "updated_at", "user_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["account_id", 4], ["created_at", Sat, 29 Jun 2013 02:08:49 UTC +00:00], ["updated_at", Sat, 29 Jun 2013 02:08:49 UTC +00:00], ["user_id", 4]]
58
+  (0.5ms) COMMIT
59
+ Completed 201 Created in 1127ms (Views: 0.4ms | ActiveRecord: 413.2ms)
60
+
61
+
62
+ Started POST "/v1/accounts" for 127.0.0.1 at 2013-06-28 21:10:32 -0500
63
+ Error occurred while parsing request parameters.
64
+ Contents:
65
+
66
+
67
+
68
+ MultiJson::LoadError (784: unexpected token at '{account: { name: "Testy", subdomain: "tested1", owner_attributes: {email: "testy2@example.com", password: "changeme", password_confirmation: "changeme"}}}'):
261
69
  /Users/manuelevidaurrea/.rbenv/versions/1.9.3-p429/lib/ruby/1.9.1/json/common.rb:148:in `parse'
262
- /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/config/initializers/warden/strategies/password.rb:13:in `json_params'
263
- /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/config/initializers/warden/strategies/password.rb:19:in `valid?'
264
- warden (1.2.1) lib/warden/proxy.rb:351:in `block in _run_strategies_for'
265
- warden (1.2.1) lib/warden/proxy.rb:349:in `each'
266
- warden (1.2.1) lib/warden/proxy.rb:349:in `_run_strategies_for'
267
- warden (1.2.1) lib/warden/proxy.rb:319:in `_perform_authentication'
268
- warden (1.2.1) lib/warden/proxy.rb:104:in `authenticate'
269
- /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/app/controllers/cadenero/v1/account/sessions_controller.rb:7:in `create'
270
- actionpack (3.2.13) lib/abstract_controller/base.rb:167:in `process_action'
271
- actionpack (3.2.13) lib/action_controller/metal/rendering.rb:10:in `process_action'
272
- actionpack (3.2.13) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
273
- activesupport (3.2.13) lib/active_support/callbacks.rb:403:in `_run__1518042003092558342__process_action__1356531673523270988__callbacks'
274
- activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'
275
- activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
276
- activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'
277
- actionpack (3.2.13) lib/abstract_controller/callbacks.rb:17:in `process_action'
278
- actionpack (3.2.13) lib/action_controller/metal/rescue.rb:29:in `process_action'
279
- actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
280
- activesupport (3.2.13) lib/active_support/notifications.rb:123:in `block in instrument'
281
- activesupport (3.2.13) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
282
- activesupport (3.2.13) lib/active_support/notifications.rb:123:in `instrument'
283
- actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
284
- activerecord (3.2.13) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
285
- actionpack (3.2.13) lib/abstract_controller/base.rb:121:in `process'
286
- actionpack (3.2.13) lib/abstract_controller/rendering.rb:45:in `process'
287
- actionpack (3.2.13) lib/action_controller/metal.rb:203:in `dispatch'
288
- actionpack (3.2.13) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
289
- actionpack (3.2.13) lib/action_controller/metal.rb:246:in `block in action'
290
- actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:in `call'
291
- actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
292
- actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:36:in `call'
293
- actionpack (3.2.13) lib/action_dispatch/routing/mapper.rb:42:in `call'
294
- journey (1.0.4) lib/journey/router.rb:68:in `block in call'
295
- journey (1.0.4) lib/journey/router.rb:56:in `each'
296
- journey (1.0.4) lib/journey/router.rb:56:in `call'
297
- actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:612:in `call'
298
- rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
299
- rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
300
- actionpack (3.2.13) lib/action_dispatch/middleware/cookies.rb:341:in `call'
301
- warden (1.2.1) lib/warden/manager.rb:31:in `call'
302
- railties (3.2.13) lib/rails/engine.rb:479:in `call'
303
- railties (3.2.13) lib/rails/railtie/configurable.rb:30:in `method_missing'
304
- journey (1.0.4) lib/journey/router.rb:68:in `block in call'
305
- journey (1.0.4) lib/journey/router.rb:56:in `each'
306
- journey (1.0.4) lib/journey/router.rb:56:in `call'
307
- actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:612:in `call'
308
- warden (1.2.1) lib/warden/manager.rb:35:in `block in call'
309
- warden (1.2.1) lib/warden/manager.rb:34:in `catch'
310
- warden (1.2.1) lib/warden/manager.rb:34:in `call'
311
- apartment (0.21.1) lib/apartment/elevators/generic.rb:19:in `call'
312
- apartment (0.21.1) lib/apartment/reloader.rb:19:in `call'
313
- rack (1.4.5) lib/rack/etag.rb:23:in `call'
314
- rack (1.4.5) lib/rack/conditionalget.rb:35:in `call'
315
- actionpack (3.2.13) lib/action_dispatch/middleware/head.rb:14:in `call'
316
- actionpack (3.2.13) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
317
- activerecord (3.2.13) lib/active_record/query_cache.rb:64:in `call'
318
- activerecord (3.2.13) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
319
- actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
320
- activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `_run__3083495747163351369__call__2690404325020222033__callbacks'
321
- activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'
322
- activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
323
- activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'
324
- actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
325
- actionpack (3.2.13) lib/action_dispatch/middleware/reloader.rb:65:in `call'
326
- actionpack (3.2.13) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
327
- actionpack (3.2.13) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
328
- actionpack (3.2.13) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
329
- railties (3.2.13) lib/rails/rack/logger.rb:32:in `call_app'
330
- railties (3.2.13) lib/rails/rack/logger.rb:16:in `block in call'
331
- activesupport (3.2.13) lib/active_support/tagged_logging.rb:22:in `tagged'
332
- railties (3.2.13) lib/rails/rack/logger.rb:16:in `call'
333
- actionpack (3.2.13) lib/action_dispatch/middleware/request_id.rb:22:in `call'
334
- rack (1.4.5) lib/rack/runtime.rb:17:in `call'
335
- activesupport (3.2.13) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
336
- rack (1.4.5) lib/rack/lock.rb:15:in `call'
337
- actionpack (3.2.13) lib/action_dispatch/middleware/static.rb:63:in `call'
338
- railties (3.2.13) lib/rails/engine.rb:479:in `call'
339
- railties (3.2.13) lib/rails/application.rb:223:in `call'
340
- railties (3.2.13) lib/rails/railtie/configurable.rb:30:in `method_missing'
341
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:147:in `handle'
342
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:99:in `rescue in block (2 levels) in start'
343
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:96:in `block (2 levels) in start'
344
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:86:in `each'
345
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:86:in `block in start'
346
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:66:in `loop'
347
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:66:in `start'
348
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:13:in `run'
349
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/bin/nack_worker:4:in `<main>'
350
-
351
-
352
- Rendered /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_trace.erb (6.0ms)
353
- Rendered /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (5.7ms)
354
- Rendered /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (67.3ms)
355
- Connecting to database specified by database.yml
356
- Connecting to database specified by database.yml
357
-
358
-
359
- Started GET "/" for 127.0.0.1 at 2013-06-27 22:36:21 -0500
360
- Processing by Cadenero::V1::Account::DashboardController#index as HTML
361
- Parameters: {"default"=>:json}
362
- env['warden'].authenticated?(:user): false
363
- Filter chain halted as :authenticate_user! rendered or redirected
364
- Completed 422 Unprocessable Entity in 6ms (Views: 0.3ms | ActiveRecord: 0.0ms)
365
-
366
-
367
- Started POST "/v1/sessions" for 127.0.0.1 at 2013-06-27 22:37:19 -0500
368
- Processing by Cadenero::V1::Account::SessionsController#create as HTML
369
- Parameters: {"user"=>{"email"=>"testy3@example.com", "password"=>"[FILTERED]"}, "default"=>:json}
370
- params: {"user"=>{"email"=>"testy3@example.com", "password"=>"changeme"}, "default"=>:json, "controller"=>"cadenero/v1/account/sessions", "action"=>"create"}
371
- valid? subdomain: ["test3"]
372
- json_params: {}
373
- params.empty?: true
374
- env['rack.input'].gets: {"user": {"email": "testy3@example.com", "password": "changeme"}}
375
- valid? json_params: {"user"=>{"email"=>"testy3@example.com", "password"=>"changeme"}}
376
- json_params: {}
377
- params.empty?: true
378
- env['rack.input'].gets:
379
- Completed 500 Internal Server Error in 1ms
380
-
381
- TypeError (can't convert nil into String):
382
- /Users/manuelevidaurrea/.rbenv/versions/1.9.3-p429/lib/ruby/1.9.1/json/common.rb:148:in `initialize'
383
- /Users/manuelevidaurrea/.rbenv/versions/1.9.3-p429/lib/ruby/1.9.1/json/common.rb:148:in `new'
384
70
  /Users/manuelevidaurrea/.rbenv/versions/1.9.3-p429/lib/ruby/1.9.1/json/common.rb:148:in `parse'
385
- /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/config/initializers/warden/strategies/password.rb:14:in `json_params'
386
- /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/config/initializers/warden/strategies/password.rb:21:in `valid?'
387
- warden (1.2.1) lib/warden/proxy.rb:351:in `block in _run_strategies_for'
388
- warden (1.2.1) lib/warden/proxy.rb:349:in `each'
389
- warden (1.2.1) lib/warden/proxy.rb:349:in `_run_strategies_for'
390
- warden (1.2.1) lib/warden/proxy.rb:319:in `_perform_authentication'
391
- warden (1.2.1) lib/warden/proxy.rb:104:in `authenticate'
392
- /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/app/controllers/cadenero/v1/account/sessions_controller.rb:7:in `create'
393
- actionpack (3.2.13) lib/abstract_controller/base.rb:167:in `process_action'
394
- actionpack (3.2.13) lib/action_controller/metal/rendering.rb:10:in `process_action'
395
- actionpack (3.2.13) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
396
- activesupport (3.2.13) lib/active_support/callbacks.rb:403:in `_run__1143065384374630641__process_action__4077513184528746036__callbacks'
397
- activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'
398
- activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
399
- activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'
400
- actionpack (3.2.13) lib/abstract_controller/callbacks.rb:17:in `process_action'
401
- actionpack (3.2.13) lib/action_controller/metal/rescue.rb:29:in `process_action'
402
- actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
403
- activesupport (3.2.13) lib/active_support/notifications.rb:123:in `block in instrument'
404
- activesupport (3.2.13) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
405
- activesupport (3.2.13) lib/active_support/notifications.rb:123:in `instrument'
406
- actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
407
- activerecord (3.2.13) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
408
- actionpack (3.2.13) lib/abstract_controller/base.rb:121:in `process'
409
- actionpack (3.2.13) lib/abstract_controller/rendering.rb:45:in `process'
410
- actionpack (3.2.13) lib/action_controller/metal.rb:203:in `dispatch'
411
- actionpack (3.2.13) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
412
- actionpack (3.2.13) lib/action_controller/metal.rb:246:in `block in action'
413
- actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:in `call'
414
- actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
415
- actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:36:in `call'
416
- actionpack (3.2.13) lib/action_dispatch/routing/mapper.rb:42:in `call'
417
- journey (1.0.4) lib/journey/router.rb:68:in `block in call'
418
- journey (1.0.4) lib/journey/router.rb:56:in `each'
419
- journey (1.0.4) lib/journey/router.rb:56:in `call'
420
- actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:612:in `call'
421
- rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
422
- rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
423
- actionpack (3.2.13) lib/action_dispatch/middleware/cookies.rb:341:in `call'
424
- warden (1.2.1) lib/warden/manager.rb:31:in `call'
425
- railties (3.2.13) lib/rails/engine.rb:479:in `call'
426
- railties (3.2.13) lib/rails/railtie/configurable.rb:30:in `method_missing'
427
- journey (1.0.4) lib/journey/router.rb:68:in `block in call'
428
- journey (1.0.4) lib/journey/router.rb:56:in `each'
429
- journey (1.0.4) lib/journey/router.rb:56:in `call'
430
- actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:612:in `call'
431
- warden (1.2.1) lib/warden/manager.rb:35:in `block in call'
432
- warden (1.2.1) lib/warden/manager.rb:34:in `catch'
433
- warden (1.2.1) lib/warden/manager.rb:34:in `call'
434
- apartment (0.21.1) lib/apartment/elevators/generic.rb:19:in `call'
435
- apartment (0.21.1) lib/apartment/reloader.rb:19:in `call'
436
- rack (1.4.5) lib/rack/etag.rb:23:in `call'
437
- rack (1.4.5) lib/rack/conditionalget.rb:35:in `call'
438
- actionpack (3.2.13) lib/action_dispatch/middleware/head.rb:14:in `call'
439
- actionpack (3.2.13) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
71
+ multi_json (1.7.7) lib/multi_json/adapters/json_common.rb:16:in `load'
72
+ multi_json (1.7.7) lib/multi_json/adapter.rb:19:in `load'
73
+ multi_json (1.7.7) lib/multi_json.rb:130:in `load'
74
+ activesupport (3.2.13) lib/active_support/json/decoding.rb:15:in `decode'
75
+ actionpack (3.2.13) lib/action_dispatch/middleware/params_parser.rb:47:in `parse_formatted_parameters'
76
+ actionpack (3.2.13) lib/action_dispatch/middleware/params_parser.rb:17:in `call'
440
77
  activerecord (3.2.13) lib/active_record/query_cache.rb:64:in `call'
441
78
  activerecord (3.2.13) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
442
79
  actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
443
- activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `_run__971631749194060911__call__215474630939641209__callbacks'
80
+ activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `_run__1796019582061484670__call__3517173794547040874__callbacks'
444
81
  activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'
445
82
  activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
446
83
  activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'
@@ -472,144 +109,42 @@ TypeError (can't convert nil into String):
472
109
  /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/bin/nack_worker:4:in `<main>'
473
110
 
474
111
 
475
- Rendered /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.8ms)
112
+ Rendered /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.7ms)
476
113
  Rendered /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.5ms)
477
- Rendered /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (97.3ms)
478
- Connecting to database specified by database.yml
479
-
480
-
481
- Started GET "/" for 127.0.0.1 at 2013-06-27 22:38:31 -0500
482
- Processing by Cadenero::V1::Account::DashboardController#index as HTML
483
- Parameters: {"default"=>:json}
484
- env['warden'].authenticated?(:user): false
485
- Filter chain halted as :authenticate_user! rendered or redirected
486
- Completed 422 Unprocessable Entity in 5ms (Views: 0.3ms | ActiveRecord: 0.0ms)
487
-
488
-
489
- Started POST "/v1/sessions" for 127.0.0.1 at 2013-06-27 22:38:37 -0500
490
- Processing by Cadenero::V1::Account::SessionsController#create as HTML
491
- Parameters: {"user"=>{"email"=>"testy3@example.com", "password"=>"[FILTERED]"}, "default"=>:json}
492
- params: {"user"=>{"email"=>"testy3@example.com", "password"=>"changeme"}, "default"=>:json, "controller"=>"cadenero/v1/account/sessions", "action"=>"create"}
493
- valid? subdomain: ["test3"]
494
- json_params: {}
495
- params.empty?: true
496
- env['rack.input'].gets: {"user": {"email": "testy3@example.com", "password": "changeme"}}
497
- valid? json_params: {"user"=>{"email"=>"testy3@example.com", "password"=>"changeme"}}
498
- json_params: {}
499
- params.empty?: true
500
- env['rack.input'].gets: {"user": {"email": "testy3@example.com", "password": "changeme"}}
501
- subdomain: ["test3"]
502
- Cadenero::V1::Account Load (2.0ms) SELECT "public"."cadenero_accounts".* FROM "public"."cadenero_accounts" WHERE "public"."cadenero_accounts"."subdomain" IN ('test3') LIMIT 1
503
- Cadenero::V1::Account Load (0.5ms) SELECT "public"."cadenero_accounts".* FROM "public"."cadenero_accounts" WHERE "public"."cadenero_accounts"."authentication_token" = 'cxiYZpGPQ6NofqEmM8n2' LIMIT 1
504
- account: {"account":{"authentication_token":"cxiYZpGPQ6NofqEmM8n2","created_at":"2013-06-28T01:08:50Z","id":2,"name":"Testy","owner_id":2,"subdomain":"test3","updated_at":"2013-06-28T01:08:50Z"}}
505
- json_params: {}
506
- params.empty?: true
507
- env['rack.input'].gets: {"user": {"email": "testy3@example.com", "password": "changeme"}}
508
- Cadenero::User Load (6.2ms) SELECT "public"."cadenero_users".* FROM "public"."cadenero_users" INNER JOIN "public"."cadenero_members" ON "public"."cadenero_users"."id" = "public"."cadenero_members"."user_id" WHERE "public"."cadenero_members"."account_id" = 2 AND "public"."cadenero_users"."email" = 'testy3@example.com' LIMIT 1
509
- user: {"user":{"created_at":"2013-06-28T01:08:50Z","email":"testy3@example.com","id":2,"password_digest":"$2a$10$pgArrNXaaxznDs865cVjEuSnRomFzOuVsBCYi3rLvrv5OeQNmIiym","updated_at":"2013-06-28T01:08:50Z"}}
510
- authenticate user! not null: {"user":{"created_at":"2013-06-28T01:08:50Z","email":"testy3@example.com","id":2,"password_digest":"$2a$10$pgArrNXaaxznDs865cVjEuSnRomFzOuVsBCYi3rLvrv5OeQNmIiym","updated_at":"2013-06-28T01:08:50Z"}}
511
- json_params: {}
512
- params.empty?: true
513
- env['rack.input'].gets: {"user": {"email": "testy3@example.com", "password": "changeme"}}
514
- Cadenero::User Load (1.3ms) SELECT "public"."cadenero_users".* FROM "public"."cadenero_users" WHERE "public"."cadenero_users"."id" = 2 LIMIT 1
515
- Cadenero::Member Load (1.4ms) SELECT "public"."cadenero_members".* FROM "public"."cadenero_members" WHERE "public"."cadenero_members"."user_id" = 2
516
- Cadenero::V1::Account Load (1.8ms) SELECT "public"."cadenero_accounts".* FROM "public"."cadenero_accounts" INNER JOIN "public"."cadenero_members" ON "public"."cadenero_accounts"."id" = "public"."cadenero_members"."account_id" WHERE "public"."cadenero_members"."user_id" = 2
517
- Completed 201 Created in 617ms (Views: 95.4ms | ActiveRecord: 79.6ms)
518
-
519
-
520
- Started GET "/" for 127.0.0.1 at 2013-06-27 22:39:10 -0500
521
- Processing by Cadenero::V1::Account::DashboardController#index as HTML
522
- Parameters: {"default"=>:json}
523
- env['warden'].authenticated?(:user): false
524
- Filter chain halted as :authenticate_user! rendered or redirected
525
- Completed 422 Unprocessable Entity in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)
526
-
527
-
528
- Started GET "/" for 127.0.0.1 at 2013-06-27 22:39:17 -0500
529
- Processing by Cadenero::V1::Account::DashboardController#index as HTML
530
- Parameters: {"default"=>:json}
531
- env['warden'].authenticated?(:user): false
532
- Filter chain halted as :authenticate_user! rendered or redirected
533
- Completed 422 Unprocessable Entity in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)
534
- Connecting to database specified by database.yml
535
-
536
-
537
- Started POST "/v1/sessions" for 127.0.0.1 at 2013-06-27 23:43:41 -0500
538
-
539
- Apartment::SchemaNotFound (One of the following schema(s) is invalid: test3):
540
- apartment (0.21.1) lib/apartment/adapters/postgresql_adapter.rb:82:in `rescue in connect_to_new'
541
- apartment (0.21.1) lib/apartment/adapters/postgresql_adapter.rb:75:in `connect_to_new'
542
- apartment (0.21.1) lib/apartment/adapters/abstract_adapter.rb:93:in `switch'
543
- apartment (0.21.1) lib/apartment/elevators/generic.rb:17:in `call'
544
- apartment (0.21.1) lib/apartment/reloader.rb:19:in `call'
545
- rack (1.4.5) lib/rack/etag.rb:23:in `call'
546
- rack (1.4.5) lib/rack/conditionalget.rb:35:in `call'
547
- actionpack (3.2.13) lib/action_dispatch/middleware/head.rb:14:in `call'
548
- actionpack (3.2.13) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
549
- activerecord (3.2.13) lib/active_record/query_cache.rb:64:in `call'
550
- activerecord (3.2.13) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
551
- actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
552
- activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `_run__756117718638477808__call__3994278690128380133__callbacks'
553
- activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'
554
- activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
555
- activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'
556
- actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
557
- actionpack (3.2.13) lib/action_dispatch/middleware/reloader.rb:65:in `call'
558
- actionpack (3.2.13) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
559
- actionpack (3.2.13) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
560
- actionpack (3.2.13) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
561
- railties (3.2.13) lib/rails/rack/logger.rb:32:in `call_app'
562
- railties (3.2.13) lib/rails/rack/logger.rb:16:in `block in call'
563
- activesupport (3.2.13) lib/active_support/tagged_logging.rb:22:in `tagged'
564
- railties (3.2.13) lib/rails/rack/logger.rb:16:in `call'
565
- actionpack (3.2.13) lib/action_dispatch/middleware/request_id.rb:22:in `call'
566
- rack (1.4.5) lib/rack/runtime.rb:17:in `call'
567
- activesupport (3.2.13) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
568
- rack (1.4.5) lib/rack/lock.rb:15:in `call'
569
- actionpack (3.2.13) lib/action_dispatch/middleware/static.rb:63:in `call'
570
- railties (3.2.13) lib/rails/engine.rb:479:in `call'
571
- railties (3.2.13) lib/rails/application.rb:223:in `call'
572
- railties (3.2.13) lib/rails/railtie/configurable.rb:30:in `method_missing'
573
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:147:in `handle'
574
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:99:in `rescue in block (2 levels) in start'
575
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:96:in `block (2 levels) in start'
576
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:86:in `each'
577
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:86:in `block in start'
578
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:66:in `loop'
579
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:66:in `start'
580
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/lib/nack/server.rb:13:in `run'
581
- /Users/manuelevidaurrea/Library/Application Support/Pow/Versions/0.4.0/node_modules/nack/bin/nack_worker:4:in `<main>'
582
-
583
-
584
- Rendered /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.8ms)
585
- Rendered /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.2ms)
586
- Rendered /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (20.2ms)
587
-
588
-
589
- Started POST "/v1/accounts" for 127.0.0.1 at 2013-06-27 23:45:05 -0500
590
- Processing by Cadenero::V1::AccountsController#create as HTML
591
- Parameters: {"account"=>{"name"=>"Testy", "subdomain"=>"test", "owner_attributes"=>{"email"=>"testy@example.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}}, "default"=>:json}
592
-  (0.2ms) BEGIN
593
- Cadenero::V1::Account Exists (0.5ms) SELECT 1 AS one FROM "public"."cadenero_accounts" WHERE "public"."cadenero_accounts"."subdomain" = 'test' LIMIT 1
594
- SQL (2.3ms) INSERT INTO "public"."cadenero_users" ("created_at", "email", "password_digest", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", Fri, 28 Jun 2013 04:45:05 UTC +00:00], ["email", "testy@example.com"], ["password_digest", "$2a$10$ItllcpD13XNrNciXgTwWc.tyyvFtfjaTd6xNuM0Rq5b6cMKdm3DWa"], ["updated_at", Fri, 28 Jun 2013 04:45:05 UTC +00:00]]
595
- SQL (0.8ms) INSERT INTO "public"."cadenero_accounts" ("authentication_token", "created_at", "name", "owner_id", "subdomain", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["authentication_token", nil], ["created_at", Fri, 28 Jun 2013 04:45:06 UTC +00:00], ["name", "Testy"], ["owner_id", 3], ["subdomain", "test"], ["updated_at", Fri, 28 Jun 2013 04:45:06 UTC +00:00]]
114
+ Rendered /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (23.7ms)
115
+
116
+
117
+ Started POST "/v1/accounts" for 127.0.0.1 at 2013-06-28 21:11:29 -0500
118
+ Processing by Cadenero::V1::AccountsController#create as */*
119
+ Parameters: {"account"=>{"name"=>"Testy", "subdomain"=>"tested1", "owner_attributes"=>{"email"=>"testy2@example.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}}, "default"=>:json}
120
+ AccountsController params[:account]: {"name"=>"Testy", "subdomain"=>"tested1", "owner_attributes"=>{"email"=>"testy2@example.com", "password"=>"changeme", "password_confirmation"=>"changeme"}}
121
+  (0.1ms) BEGIN
122
+ Cadenero::V1::Account Exists (0.2ms) SELECT 1 AS one FROM "public"."cadenero_accounts" WHERE "public"."cadenero_accounts"."subdomain" = 'tested1' LIMIT 1
123
+ SQL (0.6ms) INSERT INTO "public"."cadenero_users" ("created_at", "email", "password_digest", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", Sat, 29 Jun 2013 02:11:29 UTC +00:00], ["email", "testy2@example.com"], ["password_digest", "$2a$10$jxGVrWyvKjETuIjMP8Nkmuqea8NUo.JQ9soPMsHskN4Xk/ilR7You"], ["updated_at", Sat, 29 Jun 2013 02:11:29 UTC +00:00]]
124
+ SQL (0.6ms) INSERT INTO "public"."cadenero_accounts" ("authentication_token", "created_at", "name", "owner_id", "subdomain", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["authentication_token", nil], ["created_at", Sat, 29 Jun 2013 02:11:29 UTC +00:00], ["name", "Testy"], ["owner_id", 5], ["subdomain", "tested1"], ["updated_at", Sat, 29 Jun 2013 02:11:29 UTC +00:00]]
125
+ Cadenero::V1::Account Load (0.3ms) SELECT "public"."cadenero_accounts".* FROM "public"."cadenero_accounts" WHERE "public"."cadenero_accounts"."authentication_token" = '7Yyb4MCNW9nfa46sW5aP' LIMIT 1
126
+  (0.2ms) UPDATE "public"."cadenero_accounts" SET "name" = 'Testy', "subdomain" = 'tested1', "owner_id" = 5, "created_at" = '2013-06-29 02:11:29.978495', "updated_at" = '2013-06-29 02:11:29.978495' WHERE "public"."cadenero_accounts"."id" = 5
127
+  (2.0ms) COMMIT
128
+  (0.1ms) BEGIN
129
+ SQL (1.2ms) INSERT INTO "public"."cadenero_members" ("account_id", "created_at", "updated_at", "user_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["account_id", 5], ["created_at", Sat, 29 Jun 2013 02:11:29 UTC +00:00], ["updated_at", Sat, 29 Jun 2013 02:11:29 UTC +00:00], ["user_id", 5]]
596
130
   (0.7ms) COMMIT
597
-  (0.2ms) BEGIN
598
- SQL (1.0ms) INSERT INTO "public"."cadenero_members" ("account_id", "created_at", "updated_at", "user_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["account_id", 3], ["created_at", Fri, 28 Jun 2013 04:45:06 UTC +00:00], ["updated_at", Fri, 28 Jun 2013 04:45:06 UTC +00:00], ["user_id", 3]]
599
-  (0.9ms) COMMIT
600
- Cadenero::V1::Account Exists (0.5ms) SELECT 1 AS one FROM "public"."cadenero_accounts" WHERE ("public"."cadenero_accounts"."subdomain" = 'test' AND "public"."cadenero_accounts"."id" != 3) LIMIT 1
601
-  (1.3ms) CREATE SCHEMA "test"
602
-  (13.7ms) CREATE TABLE "cadenero_accounts" ("id" serial primary key, "name" character varying(255), "subdomain" character varying(255), "authentication_token" character varying(255), "owner_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
603
-  (1.5ms) CREATE INDEX "index_cadenero_accounts_on_authentication_token" ON "cadenero_accounts" ("authentication_token")
604
-  (2.3ms) CREATE INDEX "index_cadenero_accounts_on_owner_id" ON "cadenero_accounts" ("owner_id")
605
-  (4.6ms) CREATE TABLE "cadenero_members" ("id" serial primary key, "account_id" integer, "user_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
606
-  (1.5ms) CREATE INDEX "index_cadenero_members_on_account_id" ON "cadenero_members" ("account_id")
607
-  (8.9ms) CREATE INDEX "index_cadenero_members_on_user_id" ON "cadenero_members" ("user_id")
608
-  (5.8ms) CREATE TABLE "cadenero_users" ("id" serial primary key, "email" character varying(255), "password_digest" character varying(255), "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
609
-  (4.5ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)
610
-  (5.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
611
-  (0.3ms) SELECT version FROM "schema_migrations"
612
-  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20130612073709')
613
- Cadenero::V1::Account Load (0.5ms) SELECT "public"."cadenero_accounts".* FROM "public"."cadenero_accounts" WHERE "public"."cadenero_accounts"."authentication_token" = 'uugLhBDmxWtCPAbbqUps' LIMIT 1
614
- Cadenero::V1::Account Load (0.2ms) SELECT "public"."cadenero_accounts".* FROM "public"."cadenero_accounts" WHERE "public"."cadenero_accounts"."authentication_token" = 'i4tz4J5zEFMc21WfrLPs' LIMIT 1
615
- Completed 201 Created in 423ms (Views: 0.2ms | ActiveRecord: 78.7ms)
131
+ Cadenero::V1::Account Exists (0.3ms) SELECT 1 AS one FROM "public"."cadenero_accounts" WHERE ("public"."cadenero_accounts"."subdomain" = 'tested1' AND "public"."cadenero_accounts"."id" != 5) LIMIT 1
132
+  (0.7ms) CREATE SCHEMA "tested1"
133
+  (8.6ms) CREATE TABLE "cadenero_accounts" ("id" serial primary key, "name" character varying(255), "subdomain" character varying(255), "authentication_token" character varying(255), "owner_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
134
+  (4.3ms) CREATE INDEX "index_cadenero_accounts_on_authentication_token" ON "cadenero_accounts" ("authentication_token")
135
+  (1.3ms) CREATE INDEX "index_cadenero_accounts_on_owner_id" ON "cadenero_accounts" ("owner_id")
136
+  (3.6ms) CREATE TABLE "cadenero_members" ("id" serial primary key, "account_id" integer, "user_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
137
+  (1.4ms) CREATE INDEX "index_cadenero_members_on_account_id" ON "cadenero_members" ("account_id")
138
+  (1.1ms) CREATE INDEX "index_cadenero_members_on_user_id" ON "cadenero_members" ("user_id")
139
+  (9.0ms) CREATE TABLE "cadenero_users" ("id" serial primary key, "email" character varying(255), "password_digest" character varying(255), "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
140
+  (3.8ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) 
141
+  (1.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
142
+  (0.3ms) SELECT version FROM "schema_migrations"
143
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20130612073709')
144
+ Cadenero::V1::Account Load (0.5ms) SELECT "public"."cadenero_accounts".* FROM "public"."cadenero_accounts" WHERE "public"."cadenero_accounts"."authentication_token" = 'd2xUVTsHdwULLQJYW2z3' LIMIT 1
145
+  (0.1ms) BEGIN
146
+  (0.1ms) COMMIT
147
+  (0.6ms) BEGIN
148
+ SQL (0.5ms) INSERT INTO "public"."cadenero_members" ("account_id", "created_at", "updated_at", "user_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["account_id", 5], ["created_at", Sat, 29 Jun 2013 02:11:30 UTC +00:00], ["updated_at", Sat, 29 Jun 2013 02:11:30 UTC +00:00], ["user_id", 5]]
149
+  (1.2ms) COMMIT
150
+ Completed 201 Created in 292ms (Views: 0.3ms | ActiveRecord: 77.7ms)