oauth_service 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/oauth_service/access_controller.rb +6 -6
  3. data/app/controllers/oauth_service/login_controller.rb +50 -46
  4. data/app/models/oauth_service/url.rb +1 -1
  5. data/app/models/oauth_service/user_group.rb +1 -0
  6. data/app/models/oauth_service/users_url.rb +1 -1
  7. data/config/routes.rb +1 -1
  8. data/lib/generators/templates/migrations/create_tables.rb +10 -8
  9. data/lib/oauth_service/version.rb +1 -1
  10. data/test/dummy/Guest +0 -0
  11. data/test/dummy/app/controllers/test_controller.rb +5 -0
  12. data/test/dummy/config/routes.rb +1 -0
  13. data/test/dummy/db/development.sqlite3 +0 -0
  14. data/test/dummy/db/migrate/20160514163909_create_tables.rb +2 -8
  15. data/test/dummy/db/schema.rb +1 -1
  16. data/test/dummy/db/test.sqlite3 +0 -0
  17. data/test/dummy/guest +0 -0
  18. data/test/dummy/guest_url1.id, +0 -0
  19. data/test/dummy/guest_url2.id, +0 -0
  20. data/test/dummy/guest_url3.id, +0 -0
  21. data/test/dummy/guest_user.id, +0 -0
  22. data/test/dummy/guest_user_group.id +0 -0
  23. data/test/dummy/log/development.log +1355 -0
  24. data/test/dummy/log/test.log +6946 -0
  25. data/test/dummy/tmp/cache/assets/sprockets/v3.0/5L/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache +0 -0
  26. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Iv/IvDM1j8-H1H6kEjVCsyIW8N2zla-aIp9q_OE9PVZtVw.cache +1 -0
  27. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Kd/KdigzwGrQTqj2flci68yo521CArM4ud2rtF9LJYHYKg.cache +0 -0
  28. data/test/dummy/tmp/cache/assets/sprockets/v3.0/OI/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache +0 -0
  29. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ol/OlBX9JIv9SAOmK2t35x1SYDx1sxCXF0yvqpna3WMyH0.cache +1 -0
  30. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Tb/TbNNT2ADDg0nsOqddkrls4KLYP00SwI0Mu9N0Map59I.cache +0 -0
  31. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Yr/YrZ0OIHu42cExs1kqngMA6ShVDKhfGmhyW-E9haNo5Y.cache +1 -0
  32. data/test/dummy/tmp/cache/assets/sprockets/v3.0/gp/gpiWtnqpufka8lRtMznM6Ko0aWJrcH_j8cfZwdYmzNI.cache +1 -0
  33. data/test/dummy/tmp/cache/assets/sprockets/v3.0/gt/gtIZouUfo47GX64nbj9TVIbdodEWvOtDa3m_ya6c6ms.cache +0 -0
  34. data/test/dummy/tmp/cache/assets/sprockets/v3.0/hZ/hZi1k6tpxxCGYxRe7zY74ItcOI8gZrREOpGuA8JSpGg.cache +0 -0
  35. data/test/dummy/tmp/cache/assets/sprockets/v3.0/pE/pEhaat2KBd5SrT7szC_8R1_6hK17FTpvoRFkmCRSD3M.cache +0 -0
  36. data/test/dummy/tmp/cache/assets/sprockets/v3.0/pr/pr7yzrpqKSQI10FniqVIsZ9wiTs-DKEGBV_zmGiIxOs.cache +0 -0
  37. data/test/helpers/capybara_helper.rb +65 -0
  38. data/test/{test_helper.rb → helpers/test_helper.rb} +2 -8
  39. data/test/oauth_service_provider_test.rb +40 -3
  40. metadata +40 -26
  41. data/test/dummy/test/fixtures/urls.yml +0 -17
  42. data/test/dummy/test/fixtures/user_groups.yml +0 -7
  43. data/test/dummy/test/fixtures/users.yml +0 -9
  44. data/test/dummy/test/fixtures/users_groups.yml +0 -9
  45. data/test/dummy/test/fixtures/users_urls.yml +0 -9
  46. data/test/dummy/test/models/url_test.rb +0 -7
  47. data/test/dummy/test/models/user_group_test.rb +0 -7
  48. data/test/dummy/test/models/user_test.rb +0 -7
  49. data/test/dummy/test/models/users_group_test.rb +0 -7
  50. data/test/dummy/test/models/users_url_test.rb +0 -7
  51. data/test/oauth_service_test.rb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fc4e4f436f6b04ef9ba3061db91a2d1c9e49649c
4
- data.tar.gz: 39e7c45adb3f4a851ee20d40dfad135eb4e97046
3
+ metadata.gz: e60b35d6404d54c523c622ccaf9f740ebc68d4a6
4
+ data.tar.gz: 46530fb9a1634aeb9c4ddec2f2456e729693feae
5
5
  SHA512:
6
- metadata.gz: d119e5c4b4dd7fac49b8d020ef06bfa200212e35c72d0590093dc15b74f76f3eaa9eb3eeb933bb8c8fa4aa808f45fa739de87365f55d4352b646e1e1324cb671
7
- data.tar.gz: 8e167caf502e999ae856fe346a02bf93fddbb3babfd277876ba086b8e6a67bcbdbcc75933c04e1155bbff2e000c786a7ff301dda7c6b00a188abc64a50d07a9a
6
+ metadata.gz: 031a68b5d3e7b0e76972efa0c43527ba0f2bfedc014d65a4683e6a7dcc888d59fee63deba8902a7b0b387d1f8854fb6893af8d62a74b1c4c8cb5064621c2a4f0
7
+ data.tar.gz: fcafefc9dd6ba970db50cec2e3f23eb86f976cbdfeecf26b32fc9d18dc9ec0fcd1bb5c5254493ba53f8899b2e99d8fdcc344717c026383b13932700bc79236d2
@@ -2,20 +2,20 @@ module OauthService
2
2
  class AccessController < OauthService.parent_controller.constantize
3
3
  before_filter :check_access
4
4
 
5
- def get_user_id
5
+ def get_user
6
6
  if (api_code = request.headers["HTTP_API_CODE"]) && api_code!=""
7
7
  user = ::User.find_by(api_code: api_code)
8
- else
9
- user = ::User.find_by(name: "guest")
10
8
  end
11
- user.id
9
+
10
+ user = user.nil? ? ::User.find_by(name: "guest") : user
12
11
  end
13
12
 
14
13
  def check_access
15
14
  check_status = false
16
15
  path = request.path
17
16
  http_method = request.method.to_s
18
- user_urls = ::Url.by_user get_user_id
17
+ user = get_user
18
+ user_urls = ::Url.by_user user.id
19
19
 
20
20
  check_status = user_urls.any? do |user_url|
21
21
  path[Regexp.new(user_url.url_pattern)]==path &&
@@ -23,7 +23,7 @@ module OauthService
23
23
  end
24
24
 
25
25
  unless check_status
26
- if request.headers["HTTP_API_CODE"]
26
+ if request.headers["HTTP_API_CODE"] && user.name != "guest"
27
27
  render :json => {:success => false, :error => "Not authorized"}, :status => 401
28
28
  else
29
29
  render :json => {:success => false, :error => "Permission denied"}, :status => 403
@@ -20,13 +20,17 @@ module OauthService
20
20
  end
21
21
 
22
22
  def logout
23
- user = ::User.find_by(api_code: api_code)
24
- success = user.blank?
25
- unless success
26
- user.update_attributes(:api_code => nil)
27
- render :json => {:success => true}, :status => 400
23
+ if (api_code = request.headers["HTTP_API_CODE"]) && api_code!=""
24
+ user = ::User.find_by(api_code: api_code)
25
+ success = user.blank?
26
+ unless success
27
+ user.update_attributes(:api_code => nil)
28
+ render :json => {:success => true}, :status => 200
29
+ else
30
+ render :json => {:success => false, :error => "No such user exists"}, :status => 400
31
+ end
28
32
  else
29
- render :json => {:success => false, :error=> "No such user exists"}, :status => 400
33
+ render :json => {:success => false, :error => "No api_code in request"}, :status => 400
30
34
  end
31
35
  end
32
36
 
@@ -36,55 +40,55 @@ module OauthService
36
40
  end
37
41
 
38
42
  def get_user_info(provider_name, redirect_uri, code)
39
- provider = OauthService::Provider::get_provider_by_name(provider_name)
40
- token_uri = URI.parse(provider.token_url)
41
- http_token = Net::HTTP.new(token_uri.host, token_uri.port)
42
- http_token.use_ssl = true if token_uri.scheme == "https"
43
-
44
- http_token.start do |http_token_request|
45
- res = http_token_request.send_request("POST",
46
- token_uri.request_uri,
47
- URI.encode_www_form(provider.get_token_params(original_url: redirect_uri, code: code)),
48
- { 'Content-Type' => "application/x-www-form-urlencoded" })
43
+ provider = OauthService::Provider::get_provider_by_name(provider_name)
44
+ token_uri = URI.parse(provider.token_url)
45
+ http_token = Net::HTTP.new(token_uri.host, token_uri.port)
46
+ http_token.use_ssl = true if token_uri.scheme == "https"
49
47
 
50
- res_body = ActiveSupport::JSON.decode(res.body).symbolize_keys
51
-
52
- if res.code!='200'
53
- render :json => {
54
- :success => false,
55
- :error => res_body[:error],
56
- :error_description => res_body[:error_description]
57
- },
58
- :status => res.code
59
- return false
60
- end
61
-
62
- info_uri = URI.parse(provider.info_url + "?" +
63
- URI.encode_www_form(provider.get_info_params(access_token: res_body[:access_token])))
64
- http_info = Net::HTTP.new(info_uri.host, info_uri.port)
65
- http_info.use_ssl = true if info_uri.scheme == "https"
66
-
67
- http_info.start do |http_info_request|
68
- res = http_info_request.send_request("GET",
69
- info_uri.request_uri,
70
- nil,
71
- provider.get_info_headers(access_token: res_body[:access_token]))
72
-
73
- res_body = ActiveSupport::JSON.decode(res.body).symbolize_keys
48
+ http_token.start do |http_token_request|
49
+ res = http_token_request.send_request("POST",
50
+ token_uri.request_uri,
51
+ URI.encode_www_form(provider.get_token_params(original_url: redirect_uri, code: code)),
52
+ { 'Content-Type' => "application/x-www-form-urlencoded" })
74
53
 
54
+ res_body = ActiveSupport::JSON.decode(res.body).symbolize_keys
55
+
75
56
  if res.code!='200'
76
57
  render :json => {
77
- :success => false,
78
- :error => res_body[:error],
79
- :error_description => res_body[:error_description]
80
- },
58
+ :success => false,
59
+ :error => res_body[:error],
60
+ :error_description => res_body[:error_description]
61
+ },
81
62
  :status => res.code
82
63
  return false
83
64
  end
84
- provider.get_user_info(res_body)
65
+
66
+ info_uri = URI.parse(provider.info_url + "?" +
67
+ URI.encode_www_form(provider.get_info_params(access_token: res_body[:access_token])))
68
+ http_info = Net::HTTP.new(info_uri.host, info_uri.port)
69
+ http_info.use_ssl = true if info_uri.scheme == "https"
70
+
71
+ http_info.start do |http_info_request|
72
+ res = http_info_request.send_request("GET",
73
+ info_uri.request_uri,
74
+ nil,
75
+ provider.get_info_headers(access_token: res_body[:access_token]))
76
+
77
+ res_body = ActiveSupport::JSON.decode(res.body).symbolize_keys
78
+
79
+ if res.code!='200'
80
+ render :json => {
81
+ :success => false,
82
+ :error => res_body[:error],
83
+ :error_description => res_body[:error_description]
84
+ },
85
+ :status => res.code
86
+ return false
87
+ end
88
+ provider.get_user_info(res_body)
89
+ end
85
90
  end
86
91
  end
87
- end
88
92
  end
89
93
  end
90
94
 
@@ -3,7 +3,7 @@ module OauthService
3
3
  has_many :users_url
4
4
 
5
5
  def self.by_user(user_id)
6
- includes(users_url: [users_group: [:user]]).where(:users_groups => {:user_id => user_id}).all
6
+ includes(users_url: [user_group: [[users_group: :user]]]).where(:users_groups => {:user_id => user_id}).all
7
7
  end
8
8
  end
9
9
  end
@@ -1,5 +1,6 @@
1
1
  module OauthService
2
2
  class UserGroup < ActiveRecord::Base
3
3
  has_many :users_group
4
+ has_many :users_url
4
5
  end
5
6
  end
@@ -1,6 +1,6 @@
1
1
  module OauthService
2
2
  class UsersUrl < ActiveRecord::Base
3
3
  belongs_to :url
4
- belongs_to :users_group
4
+ belongs_to :user_group
5
5
  end
6
6
  end
data/config/routes.rb CHANGED
@@ -2,5 +2,5 @@ require "oauth_service"
2
2
 
3
3
  Rails.application.routes.draw do
4
4
  get "#{OauthService.redirect_uri}/:provider_name", to: "#{OauthService.login_controller[0..-11].downcase}#oauth_callback"
5
- get "#{OauthService.redirect_uri}/logout", to: "#{OauthService.login_controller[0..-11].downcase}#logout"
5
+ get "#{OauthService.login_controller[0..-11].downcase}/logout", to: "#{OauthService.login_controller[0..-11].downcase}#logout"
6
6
  end
@@ -22,17 +22,19 @@ class CreateTables < ActiveRecord::Migration
22
22
  end
23
23
 
24
24
  create_table :users_urls do |t|
25
- t.integer :users_group_id
25
+ t.integer :user_group_id
26
26
  t.integer :url_id
27
27
  end
28
28
 
29
- User.create :name => "guest", :id => 1
30
- Url.create :url_pattern => "^/login", :name => "Login page", :http_method => "GET", :id => 1
31
- Url.create :url_pattern => "^/oauth/.*", :name => "AuthCallback page", :http_method => "GET", :id => 2
32
- UserGroup.create :id => 1, :name => "Guest"
33
- UsersGroup.create :id => 1, :user_id => 1, :user_group_id => 1
34
- UsersUrl.create :id => 1, :url_id => 1, :users_group_id => 1
35
- UsersUrl.create :id => 2, :url_id => 2, :users_group_id => 1
29
+ guest_user = User.create :name => "guest"
30
+ guest_url1 = Url.create :url_pattern => "^/login", :name => "Login page", :http_method => "GET"
31
+ guest_url2 = Url.create :url_pattern => "^/oauth/.*", :name => "AuthCallback page", :http_method => "GET"
32
+ guest_url3 = Url.create :url_pattern => "^/login/logout", :name => "Logout page", :http_method => "GET"
33
+ guest_user_group = UserGroup.create :name => "Guest"
34
+ guest_users_group = UsersGroup.create :user_id => guest_user.id, :user_group_id => guest_user_group.id
35
+ UsersUrl.create :url_id => guest_url1.id, :user_group_id => guest_user_group.id
36
+ UsersUrl.create :url_id => guest_url2.id, :user_group_id => guest_user_group.id
37
+ UsersUrl.create :url_id => guest_url3.id, :user_group_id => guest_user_group.id
36
38
  end
37
39
 
38
40
  def self.down
@@ -1,3 +1,3 @@
1
1
  module OauthService
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/test/dummy/Guest ADDED
File without changes
@@ -0,0 +1,5 @@
1
+ class TestController < OauthService::AccessController
2
+ def index
3
+ render :json => {:hello => true}
4
+ end
5
+ end
@@ -1,6 +1,7 @@
1
1
  Rails.application.routes.draw do
2
2
  get 'login', to: 'login#index'
3
3
  get 'd', to: 'd#index'
4
+ get 'test', to: 'test#index'
4
5
  # The priority is based upon order of creation: first created -> highest priority.
5
6
  # See how all your routes lay out with "rake routes".
6
7
 
Binary file
@@ -22,17 +22,11 @@ class CreateTables < ActiveRecord::Migration
22
22
  end
23
23
 
24
24
  create_table :users_urls do |t|
25
- t.integer :users_group_id
25
+ t.integer :user_group_id
26
26
  t.integer :url_id
27
27
  end
28
28
 
29
- User.create :name => "guest", :id => 1
30
- Url.create :url_pattern => "^/login", :name => "Login page", :http_method => "GET", :id => 1
31
- Url.create :url_pattern => "^/oauth/.*", :name => "AuthCallback page", :http_method => "GET", :id => 2
32
- UserGroup.create :id => 1, :name => "Guest"
33
- UsersGroup.create :id => 1, :user_id => 1, :user_group_id => 1
34
- UsersUrl.create :id => 1, :url_id => 1, :users_group_id => 1
35
- UsersUrl.create :id => 2, :url_id => 2, :users_group_id => 1
29
+
36
30
  end
37
31
 
38
32
  def self.down
@@ -38,7 +38,7 @@ ActiveRecord::Schema.define(version: 20160514163909) do
38
38
  end
39
39
 
40
40
  create_table "users_urls", force: :cascade do |t|
41
- t.integer "users_group_id"
41
+ t.integer "user_group_id"
42
42
  t.integer "url_id"
43
43
  end
44
44
 
Binary file
data/test/dummy/guest ADDED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -17800,3 +17800,1358 @@ Processing by LoginController#oauth_callback as HTML
17800
17800
  SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1
17801
17801
  User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "y.barkovskij@unact.ru"]]
17802
17802
  Completed 404 Not Found in 554ms (Views: 0.2ms | ActiveRecord: 0.6ms)
17803
+
17804
+
17805
+ Started GET "/login" for 127.0.0.1 at 2016-05-15 00:59:08 +0300
17806
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
17807
+ Processing by LoginController#index as HTML
17808
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]]
17809
+ SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1
17810
+ Rendered login/index.html.erb within layouts/application (2.2ms)
17811
+ Completed 200 OK in 176ms (Views: 140.1ms | ActiveRecord: 1.1ms)
17812
+
17813
+
17814
+ Started GET "/assets/application.self-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css?body=1" for 127.0.0.1 at 2016-05-15 00:59:08 +0300
17815
+
17816
+
17817
+ Started GET "/assets/application.self-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js?body=1" for 127.0.0.1 at 2016-05-15 00:59:08 +0300
17818
+
17819
+
17820
+ Started GET "/" for 127.0.0.1 at 2016-05-15 01:14:05 +0300
17821
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
17822
+ Processing by Rails::WelcomeController#index as HTML
17823
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/railties-4.2.6/lib/rails/templates/rails/welcome/index.html.erb (0.9ms)
17824
+ Completed 200 OK in 5ms (Views: 4.8ms | ActiveRecord: 0.0ms)
17825
+
17826
+
17827
+ Started GET "/login" for 127.0.0.1 at 2016-05-15 01:14:09 +0300
17828
+ Processing by LoginController#index as HTML
17829
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]]
17830
+ SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1
17831
+ Rendered login/index.html.erb within layouts/application (1.8ms)
17832
+ Completed 200 OK in 174ms (Views: 131.2ms | ActiveRecord: 1.1ms)
17833
+
17834
+
17835
+ Started GET "/login" for 127.0.0.1 at 2016-05-15 01:14:09 +0300
17836
+ Processing by LoginController#index as HTML
17837
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]]
17838
+ SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1
17839
+ Rendered login/index.html.erb within layouts/application (0.6ms)
17840
+ Completed 200 OK in 17ms (Views: 13.2ms | ActiveRecord: 0.3ms)
17841
+
17842
+
17843
+ Started GET "/oauth/yandex?code=4015634" for 127.0.0.1 at 2016-05-15 01:14:11 +0300
17844
+ Processing by LoginController#oauth_callback as HTML
17845
+ Parameters: {"code"=>"4015634", "provider_name"=>"yandex"}
17846
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]]
17847
+ SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1
17848
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "bar555@yandex.ru"]]
17849
+ Completed 404 Not Found in 222ms (Views: 0.2ms | ActiveRecord: 0.7ms)
17850
+
17851
+
17852
+ Started GET "/__identify__" for 127.0.0.1 at 2016-05-15 01:35:42 +0300
17853
+
17854
+ ActionController::RoutingError (No route matches [GET] "/__identify__"):
17855
+ actionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
17856
+ actionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
17857
+ railties (4.2.6) lib/rails/rack/logger.rb:38:in `call_app'
17858
+ railties (4.2.6) lib/rails/rack/logger.rb:20:in `block in call'
17859
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `block in tagged'
17860
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:26:in `tagged'
17861
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `tagged'
17862
+ railties (4.2.6) lib/rails/rack/logger.rb:20:in `call'
17863
+ actionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call'
17864
+ rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
17865
+ rack (1.6.4) lib/rack/runtime.rb:18:in `call'
17866
+ activesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
17867
+ rack (1.6.4) lib/rack/lock.rb:17:in `call'
17868
+ actionpack (4.2.6) lib/action_dispatch/middleware/static.rb:120:in `call'
17869
+ rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
17870
+ railties (4.2.6) lib/rails/engine.rb:518:in `call'
17871
+ railties (4.2.6) lib/rails/application.rb:165:in `call'
17872
+ rack (1.6.4) lib/rack/lock.rb:17:in `call'
17873
+ rack (1.6.4) lib/rack/content_length.rb:15:in `call'
17874
+ rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
17875
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
17876
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
17877
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
17878
+
17879
+
17880
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.0ms)
17881
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/routes/_route.html.erb (0.6ms)
17882
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/routes/_table.html.erb (7.2ms)
17883
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.8ms)
17884
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout (25.7ms)
17885
+
17886
+
17887
+ Started GET "/__identify__" for 127.0.0.1 at 2016-05-15 01:35:42 +0300
17888
+
17889
+ ActionController::RoutingError (No route matches [GET] "/__identify__"):
17890
+ actionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
17891
+ actionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
17892
+ railties (4.2.6) lib/rails/rack/logger.rb:38:in `call_app'
17893
+ railties (4.2.6) lib/rails/rack/logger.rb:20:in `block in call'
17894
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `block in tagged'
17895
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:26:in `tagged'
17896
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `tagged'
17897
+ railties (4.2.6) lib/rails/rack/logger.rb:20:in `call'
17898
+ actionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call'
17899
+ rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
17900
+ rack (1.6.4) lib/rack/runtime.rb:18:in `call'
17901
+ activesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
17902
+ rack (1.6.4) lib/rack/lock.rb:17:in `call'
17903
+ actionpack (4.2.6) lib/action_dispatch/middleware/static.rb:120:in `call'
17904
+ rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
17905
+ railties (4.2.6) lib/rails/engine.rb:518:in `call'
17906
+ railties (4.2.6) lib/rails/application.rb:165:in `call'
17907
+ rack (1.6.4) lib/rack/lock.rb:17:in `call'
17908
+ rack (1.6.4) lib/rack/content_length.rb:15:in `call'
17909
+ rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
17910
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
17911
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
17912
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
17913
+
17914
+
17915
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.0ms)
17916
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/routes/_route.html.erb (0.6ms)
17917
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/routes/_table.html.erb (0.9ms)
17918
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.7ms)
17919
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout (13.0ms)
17920
+ User Load (0.4ms) SELECT "users".* FROM "users"
17921
+ User Load (0.1ms) SELECT "users".* FROM "users"
17922
+ User Load (0.2ms) SELECT "users".* FROM "users"
17923
+  (85.1ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
17924
+  (0.3ms) select sqlite_version(*)
17925
+  (97.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
17926
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
17927
+ Migrating to CreateTables (20160514163909)
17928
+  (0.1ms) begin transaction
17929
+  (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)
17930
+  (0.4ms) CREATE INDEX "index_users_on_name" ON "users" ("name")
17931
+  (0.4ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)
17932
+  (0.4ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) 
17933
+  (0.4ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name")
17934
+  (0.4ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer) 
17935
+  (0.4ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "users_group_id" integer, "url_id" integer)
17936
+ SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]]
17937
+ SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]]
17938
+ SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]]
17939
+ SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]]
17940
+ SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]]
17941
+ SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]]
17942
+ SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]]
17943
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160514163909"]]
17944
+  (126.1ms) commit transaction
17945
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
17946
+  (0.4ms)  SELECT sql
17947
+ FROM sqlite_master
17948
+ WHERE name='index_user_groups_on_name' AND type='index'
17949
+ UNION ALL
17950
+ SELECT sql
17951
+ FROM sqlite_temp_master
17952
+ WHERE name='index_user_groups_on_name' AND type='index'
17953
+ 
17954
+  (0.3ms) SELECT sql
17955
+ FROM sqlite_master
17956
+ WHERE name='index_users_on_name' AND type='index'
17957
+ UNION ALL
17958
+ SELECT sql
17959
+ FROM sqlite_temp_master
17960
+ WHERE name='index_users_on_name' AND type='index'
17961
+
17962
+  (103.0ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
17963
+  (0.3ms) select sqlite_version(*)
17964
+  (97.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
17965
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
17966
+ Migrating to CreateTables (20160514163909)
17967
+  (0.2ms) begin transaction
17968
+  (0.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)
17969
+  (0.4ms) CREATE INDEX "index_users_on_name" ON "users" ("name")
17970
+  (0.5ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)
17971
+  (0.4ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) 
17972
+  (0.4ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name")
17973
+  (0.4ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer) 
17974
+  (0.4ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "users_group_id" integer, "url_id" integer)
17975
+ SQL (0.3ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]]
17976
+ SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]]
17977
+ SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]]
17978
+ SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]]
17979
+ SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]]
17980
+ SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]]
17981
+ SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]]
17982
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160514163909"]]
17983
+  (105.7ms) commit transaction
17984
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
17985
+  (0.2ms)  SELECT sql
17986
+ FROM sqlite_master
17987
+ WHERE name='index_user_groups_on_name' AND type='index'
17988
+ UNION ALL
17989
+ SELECT sql
17990
+ FROM sqlite_temp_master
17991
+ WHERE name='index_user_groups_on_name' AND type='index'
17992
+ 
17993
+  (0.2ms) SELECT sql
17994
+ FROM sqlite_master
17995
+ WHERE name='index_users_on_name' AND type='index'
17996
+ UNION ALL
17997
+ SELECT sql
17998
+ FROM sqlite_temp_master
17999
+ WHERE name='index_users_on_name' AND type='index'
18000
+
18001
+ SQL (0.5ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2
18002
+ SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1
18003
+ Url Load (0.4ms) SELECT "urls".* FROM "urls"
18004
+  (0.2ms) begin transaction
18005
+ SQL (0.6ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]]
18006
+  (120.0ms) commit transaction
18007
+  (0.1ms) begin transaction
18008
+ SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]]
18009
+  (106.8ms) commit transaction
18010
+  (0.1ms) begin transaction
18011
+ SQL (0.3ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]]
18012
+  (110.8ms) commit transaction
18013
+  (0.1ms) begin transaction
18014
+ SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]]
18015
+  (106.3ms) commit transaction
18016
+  (0.2ms) begin transaction
18017
+ SQL (0.6ms) INSERT INTO "users_urls" ("url_id") VALUES (?) [["url_id", 3]]
18018
+  (280.6ms) commit transaction
18019
+ SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2
18020
+  (0.2ms) begin transaction
18021
+ SQL (0.6ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 3], ["users_group_id", 2]]
18022
+  (120.8ms) commit transaction
18023
+ SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2
18024
+  (94.1ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
18025
+  (0.1ms) select sqlite_version(*)
18026
+  (74.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
18027
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
18028
+ Migrating to CreateTables (20160514163909)
18029
+  (0.1ms) begin transaction
18030
+  (0.4ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)
18031
+  (0.3ms) CREATE INDEX "index_users_on_name" ON "users" ("name")
18032
+  (0.3ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)
18033
+  (0.3ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) 
18034
+  (0.2ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name")
18035
+  (0.3ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer) 
18036
+  (0.4ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "users_group_id" integer, "url_id" integer)
18037
+ SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]]
18038
+ SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]]
18039
+ SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]]
18040
+ SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]]
18041
+ SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]]
18042
+ SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]]
18043
+ SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]]
18044
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160514163909"]]
18045
+  (110.8ms) commit transaction
18046
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
18047
+  (0.2ms)  SELECT sql
18048
+ FROM sqlite_master
18049
+ WHERE name='index_user_groups_on_name' AND type='index'
18050
+ UNION ALL
18051
+ SELECT sql
18052
+ FROM sqlite_temp_master
18053
+ WHERE name='index_user_groups_on_name' AND type='index'
18054
+ 
18055
+  (0.2ms) SELECT sql
18056
+ FROM sqlite_master
18057
+ WHERE name='index_users_on_name' AND type='index'
18058
+ UNION ALL
18059
+ SELECT sql
18060
+ FROM sqlite_temp_master
18061
+ WHERE name='index_users_on_name' AND type='index'
18062
+
18063
+  (103.8ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
18064
+  (0.2ms) select sqlite_version(*)
18065
+  (98.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
18066
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
18067
+ Migrating to CreateTables (20160514163909)
18068
+  (0.2ms) begin transaction
18069
+  (0.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)
18070
+  (0.4ms) CREATE INDEX "index_users_on_name" ON "users" ("name")
18071
+  (0.4ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)
18072
+  (0.4ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) 
18073
+  (0.4ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name")
18074
+  (0.5ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer) 
18075
+  (0.2ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "users_group_id" integer, "url_id" integer)
18076
+ SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]]
18077
+ SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]]
18078
+ SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]]
18079
+ SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]]
18080
+ SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]]
18081
+ SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]]
18082
+ SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]]
18083
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160514163909"]]
18084
+  (121.3ms) commit transaction
18085
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
18086
+  (0.2ms)  SELECT sql
18087
+ FROM sqlite_master
18088
+ WHERE name='index_user_groups_on_name' AND type='index'
18089
+ UNION ALL
18090
+ SELECT sql
18091
+ FROM sqlite_temp_master
18092
+ WHERE name='index_user_groups_on_name' AND type='index'
18093
+ 
18094
+  (0.2ms) SELECT sql
18095
+ FROM sqlite_master
18096
+ WHERE name='index_users_on_name' AND type='index'
18097
+ UNION ALL
18098
+ SELECT sql
18099
+ FROM sqlite_temp_master
18100
+ WHERE name='index_users_on_name' AND type='index'
18101
+
18102
+
18103
+
18104
+ Started GET "/login" for 127.0.0.1 at 2016-05-15 17:25:14 +0300
18105
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
18106
+ Processing by LoginController#index as HTML
18107
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]]
18108
+ CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]]
18109
+ SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1
18110
+ Rendered login/index.html.erb within layouts/application (2.3ms)
18111
+ Completed 200 OK in 178ms (Views: 138.1ms | ActiveRecord: 1.6ms)
18112
+
18113
+
18114
+ Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 17:25:17 +0300
18115
+
18116
+ ActionController::RoutingError (No route matches [GET] "/login/logout"):
18117
+ actionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
18118
+ actionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
18119
+ railties (4.2.6) lib/rails/rack/logger.rb:38:in `call_app'
18120
+ railties (4.2.6) lib/rails/rack/logger.rb:20:in `block in call'
18121
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `block in tagged'
18122
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:26:in `tagged'
18123
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `tagged'
18124
+ railties (4.2.6) lib/rails/rack/logger.rb:20:in `call'
18125
+ actionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call'
18126
+ rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
18127
+ rack (1.6.4) lib/rack/runtime.rb:18:in `call'
18128
+ activesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
18129
+ rack (1.6.4) lib/rack/lock.rb:17:in `call'
18130
+ actionpack (4.2.6) lib/action_dispatch/middleware/static.rb:120:in `call'
18131
+ rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
18132
+ railties (4.2.6) lib/rails/engine.rb:518:in `call'
18133
+ railties (4.2.6) lib/rails/application.rb:165:in `call'
18134
+ rack (1.6.4) lib/rack/lock.rb:17:in `call'
18135
+ rack (1.6.4) lib/rack/content_length.rb:15:in `call'
18136
+ rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
18137
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
18138
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
18139
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
18140
+
18141
+
18142
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.0ms)
18143
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/routes/_route.html.erb (0.7ms)
18144
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/routes/_table.html.erb (4.5ms)
18145
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.9ms)
18146
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout (19.0ms)
18147
+
18148
+
18149
+ Started GET "/oauth/logout" for 127.0.0.1 at 2016-05-15 17:25:40 +0300
18150
+ Processing by LoginController#oauth_callback as HTML
18151
+ Parameters: {"provider_name"=>"logout"}
18152
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]]
18153
+ CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]]
18154
+ SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1
18155
+ Completed 500 Internal Server Error in 8ms (ActiveRecord: 0.9ms)
18156
+
18157
+ NoMethodError (undefined method `token_url' for nil:NilClass):
18158
+ /home/dcrow/Desktop/Work/oauth_service/app/controllers/oauth_service/login_controller.rb:40:in `get_user_info'
18159
+ /home/dcrow/Desktop/Work/oauth_service/app/controllers/oauth_service/login_controller.rb:6:in `oauth_callback'
18160
+ actionpack (4.2.6) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
18161
+ actionpack (4.2.6) lib/abstract_controller/base.rb:198:in `process_action'
18162
+ actionpack (4.2.6) lib/action_controller/metal/rendering.rb:10:in `process_action'
18163
+ actionpack (4.2.6) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
18164
+ activesupport (4.2.6) lib/active_support/callbacks.rb:117:in `call'
18165
+ activesupport (4.2.6) lib/active_support/callbacks.rb:117:in `call'
18166
+ activesupport (4.2.6) lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
18167
+ activesupport (4.2.6) lib/active_support/callbacks.rb:505:in `call'
18168
+ activesupport (4.2.6) lib/active_support/callbacks.rb:505:in `call'
18169
+ activesupport (4.2.6) lib/active_support/callbacks.rb:92:in `__run_callbacks__'
18170
+ activesupport (4.2.6) lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
18171
+ activesupport (4.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks'
18172
+ actionpack (4.2.6) lib/abstract_controller/callbacks.rb:19:in `process_action'
18173
+ actionpack (4.2.6) lib/action_controller/metal/rescue.rb:29:in `process_action'
18174
+ actionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
18175
+ activesupport (4.2.6) lib/active_support/notifications.rb:164:in `block in instrument'
18176
+ activesupport (4.2.6) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
18177
+ activesupport (4.2.6) lib/active_support/notifications.rb:164:in `instrument'
18178
+ actionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
18179
+ actionpack (4.2.6) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
18180
+ activerecord (4.2.6) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
18181
+ actionpack (4.2.6) lib/abstract_controller/base.rb:137:in `process'
18182
+ actionview (4.2.6) lib/action_view/rendering.rb:30:in `process'
18183
+ actionpack (4.2.6) lib/action_controller/metal.rb:196:in `dispatch'
18184
+ actionpack (4.2.6) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
18185
+ actionpack (4.2.6) lib/action_controller/metal.rb:237:in `block in action'
18186
+ actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:74:in `call'
18187
+ actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
18188
+ actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:43:in `serve'
18189
+ actionpack (4.2.6) lib/action_dispatch/journey/router.rb:43:in `block in serve'
18190
+ actionpack (4.2.6) lib/action_dispatch/journey/router.rb:30:in `each'
18191
+ actionpack (4.2.6) lib/action_dispatch/journey/router.rb:30:in `serve'
18192
+ actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:817:in `call'
18193
+ rack (1.6.4) lib/rack/etag.rb:24:in `call'
18194
+ rack (1.6.4) lib/rack/conditionalget.rb:25:in `call'
18195
+ rack (1.6.4) lib/rack/head.rb:13:in `call'
18196
+ actionpack (4.2.6) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
18197
+ actionpack (4.2.6) lib/action_dispatch/middleware/flash.rb:260:in `call'
18198
+ rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
18199
+ rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
18200
+ actionpack (4.2.6) lib/action_dispatch/middleware/cookies.rb:560:in `call'
18201
+ activerecord (4.2.6) lib/active_record/query_cache.rb:36:in `call'
18202
+ activerecord (4.2.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
18203
+ activerecord (4.2.6) lib/active_record/migration.rb:377:in `call'
18204
+ actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
18205
+ activesupport (4.2.6) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
18206
+ activesupport (4.2.6) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
18207
+ activesupport (4.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks'
18208
+ actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
18209
+ actionpack (4.2.6) lib/action_dispatch/middleware/reloader.rb:73:in `call'
18210
+ actionpack (4.2.6) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
18211
+ actionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
18212
+ actionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
18213
+ railties (4.2.6) lib/rails/rack/logger.rb:38:in `call_app'
18214
+ railties (4.2.6) lib/rails/rack/logger.rb:20:in `block in call'
18215
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `block in tagged'
18216
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:26:in `tagged'
18217
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `tagged'
18218
+ railties (4.2.6) lib/rails/rack/logger.rb:20:in `call'
18219
+ actionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call'
18220
+ rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
18221
+ rack (1.6.4) lib/rack/runtime.rb:18:in `call'
18222
+ activesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
18223
+ rack (1.6.4) lib/rack/lock.rb:17:in `call'
18224
+ actionpack (4.2.6) lib/action_dispatch/middleware/static.rb:120:in `call'
18225
+ rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
18226
+ railties (4.2.6) lib/rails/engine.rb:518:in `call'
18227
+ railties (4.2.6) lib/rails/application.rb:165:in `call'
18228
+ rack (1.6.4) lib/rack/lock.rb:17:in `call'
18229
+ rack (1.6.4) lib/rack/content_length.rb:15:in `call'
18230
+ rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
18231
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
18232
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
18233
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
18234
+
18235
+
18236
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_source.erb (5.8ms)
18237
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.5ms)
18238
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.2ms)
18239
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (20.2ms)
18240
+
18241
+
18242
+ Started GET "/oauth/logout" for 127.0.0.1 at 2016-05-15 17:27:20 +0300
18243
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
18244
+ Processing by LoginController#oauth_callback as HTML
18245
+ Parameters: {"provider_name"=>"logout"}
18246
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]]
18247
+ CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]]
18248
+ SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1
18249
+ Completed 500 Internal Server Error in 41ms (ActiveRecord: 1.0ms)
18250
+
18251
+ NoMethodError (undefined method `token_url' for nil:NilClass):
18252
+ /home/dcrow/Desktop/Work/oauth_service/app/controllers/oauth_service/login_controller.rb:40:in `get_user_info'
18253
+ /home/dcrow/Desktop/Work/oauth_service/app/controllers/oauth_service/login_controller.rb:6:in `oauth_callback'
18254
+ actionpack (4.2.6) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
18255
+ actionpack (4.2.6) lib/abstract_controller/base.rb:198:in `process_action'
18256
+ actionpack (4.2.6) lib/action_controller/metal/rendering.rb:10:in `process_action'
18257
+ actionpack (4.2.6) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
18258
+ activesupport (4.2.6) lib/active_support/callbacks.rb:117:in `call'
18259
+ activesupport (4.2.6) lib/active_support/callbacks.rb:117:in `call'
18260
+ activesupport (4.2.6) lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
18261
+ activesupport (4.2.6) lib/active_support/callbacks.rb:505:in `call'
18262
+ activesupport (4.2.6) lib/active_support/callbacks.rb:505:in `call'
18263
+ activesupport (4.2.6) lib/active_support/callbacks.rb:92:in `__run_callbacks__'
18264
+ activesupport (4.2.6) lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
18265
+ activesupport (4.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks'
18266
+ actionpack (4.2.6) lib/abstract_controller/callbacks.rb:19:in `process_action'
18267
+ actionpack (4.2.6) lib/action_controller/metal/rescue.rb:29:in `process_action'
18268
+ actionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
18269
+ activesupport (4.2.6) lib/active_support/notifications.rb:164:in `block in instrument'
18270
+ activesupport (4.2.6) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
18271
+ activesupport (4.2.6) lib/active_support/notifications.rb:164:in `instrument'
18272
+ actionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
18273
+ actionpack (4.2.6) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
18274
+ activerecord (4.2.6) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
18275
+ actionpack (4.2.6) lib/abstract_controller/base.rb:137:in `process'
18276
+ actionview (4.2.6) lib/action_view/rendering.rb:30:in `process'
18277
+ actionpack (4.2.6) lib/action_controller/metal.rb:196:in `dispatch'
18278
+ actionpack (4.2.6) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
18279
+ actionpack (4.2.6) lib/action_controller/metal.rb:237:in `block in action'
18280
+ actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:74:in `call'
18281
+ actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
18282
+ actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:43:in `serve'
18283
+ actionpack (4.2.6) lib/action_dispatch/journey/router.rb:43:in `block in serve'
18284
+ actionpack (4.2.6) lib/action_dispatch/journey/router.rb:30:in `each'
18285
+ actionpack (4.2.6) lib/action_dispatch/journey/router.rb:30:in `serve'
18286
+ actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:817:in `call'
18287
+ rack (1.6.4) lib/rack/etag.rb:24:in `call'
18288
+ rack (1.6.4) lib/rack/conditionalget.rb:25:in `call'
18289
+ rack (1.6.4) lib/rack/head.rb:13:in `call'
18290
+ actionpack (4.2.6) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
18291
+ actionpack (4.2.6) lib/action_dispatch/middleware/flash.rb:260:in `call'
18292
+ rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
18293
+ rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
18294
+ actionpack (4.2.6) lib/action_dispatch/middleware/cookies.rb:560:in `call'
18295
+ activerecord (4.2.6) lib/active_record/query_cache.rb:36:in `call'
18296
+ activerecord (4.2.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
18297
+ activerecord (4.2.6) lib/active_record/migration.rb:377:in `call'
18298
+ actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
18299
+ activesupport (4.2.6) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
18300
+ activesupport (4.2.6) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
18301
+ activesupport (4.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks'
18302
+ actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
18303
+ actionpack (4.2.6) lib/action_dispatch/middleware/reloader.rb:73:in `call'
18304
+ actionpack (4.2.6) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
18305
+ actionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
18306
+ actionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
18307
+ railties (4.2.6) lib/rails/rack/logger.rb:38:in `call_app'
18308
+ railties (4.2.6) lib/rails/rack/logger.rb:20:in `block in call'
18309
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `block in tagged'
18310
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:26:in `tagged'
18311
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `tagged'
18312
+ railties (4.2.6) lib/rails/rack/logger.rb:20:in `call'
18313
+ actionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call'
18314
+ rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
18315
+ rack (1.6.4) lib/rack/runtime.rb:18:in `call'
18316
+ activesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
18317
+ rack (1.6.4) lib/rack/lock.rb:17:in `call'
18318
+ actionpack (4.2.6) lib/action_dispatch/middleware/static.rb:120:in `call'
18319
+ rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
18320
+ railties (4.2.6) lib/rails/engine.rb:518:in `call'
18321
+ railties (4.2.6) lib/rails/application.rb:165:in `call'
18322
+ rack (1.6.4) lib/rack/lock.rb:17:in `call'
18323
+ rack (1.6.4) lib/rack/content_length.rb:15:in `call'
18324
+ rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
18325
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
18326
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
18327
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
18328
+
18329
+
18330
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_source.erb (7.7ms)
18331
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.8ms)
18332
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (7.2ms)
18333
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (24.8ms)
18334
+
18335
+
18336
+ Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 17:29:16 +0300
18337
+ Processing by LoginController#logout as HTML
18338
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]]
18339
+ CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]]
18340
+ SQL (0.3ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1
18341
+ Filter chain halted as :check_access rendered or redirected
18342
+ Completed 403 Forbidden in 29ms (Views: 0.2ms | ActiveRecord: 1.7ms)
18343
+
18344
+
18345
+ Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 17:33:55 +0300
18346
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
18347
+ Processing by LoginController#logout as HTML
18348
+ Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.0ms)
18349
+
18350
+ NameError (undefined local variable or method `api_code' for #<LoginController:0x007f4a701b2530>):
18351
+ /home/dcrow/Desktop/Work/oauth_service/app/controllers/oauth_service/login_controller.rb:23:in `logout'
18352
+ actionpack (4.2.6) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
18353
+ actionpack (4.2.6) lib/abstract_controller/base.rb:198:in `process_action'
18354
+ actionpack (4.2.6) lib/action_controller/metal/rendering.rb:10:in `process_action'
18355
+ actionpack (4.2.6) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
18356
+ activesupport (4.2.6) lib/active_support/callbacks.rb:117:in `call'
18357
+ activesupport (4.2.6) lib/active_support/callbacks.rb:117:in `call'
18358
+ activesupport (4.2.6) lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
18359
+ activesupport (4.2.6) lib/active_support/callbacks.rb:505:in `call'
18360
+ activesupport (4.2.6) lib/active_support/callbacks.rb:505:in `call'
18361
+ activesupport (4.2.6) lib/active_support/callbacks.rb:92:in `__run_callbacks__'
18362
+ activesupport (4.2.6) lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
18363
+ activesupport (4.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks'
18364
+ actionpack (4.2.6) lib/abstract_controller/callbacks.rb:19:in `process_action'
18365
+ actionpack (4.2.6) lib/action_controller/metal/rescue.rb:29:in `process_action'
18366
+ actionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
18367
+ activesupport (4.2.6) lib/active_support/notifications.rb:164:in `block in instrument'
18368
+ activesupport (4.2.6) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
18369
+ activesupport (4.2.6) lib/active_support/notifications.rb:164:in `instrument'
18370
+ actionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
18371
+ actionpack (4.2.6) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
18372
+ activerecord (4.2.6) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
18373
+ actionpack (4.2.6) lib/abstract_controller/base.rb:137:in `process'
18374
+ actionview (4.2.6) lib/action_view/rendering.rb:30:in `process'
18375
+ actionpack (4.2.6) lib/action_controller/metal.rb:196:in `dispatch'
18376
+ actionpack (4.2.6) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
18377
+ actionpack (4.2.6) lib/action_controller/metal.rb:237:in `block in action'
18378
+ actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:74:in `call'
18379
+ actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
18380
+ actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:43:in `serve'
18381
+ actionpack (4.2.6) lib/action_dispatch/journey/router.rb:43:in `block in serve'
18382
+ actionpack (4.2.6) lib/action_dispatch/journey/router.rb:30:in `each'
18383
+ actionpack (4.2.6) lib/action_dispatch/journey/router.rb:30:in `serve'
18384
+ actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:817:in `call'
18385
+ rack (1.6.4) lib/rack/etag.rb:24:in `call'
18386
+ rack (1.6.4) lib/rack/conditionalget.rb:25:in `call'
18387
+ rack (1.6.4) lib/rack/head.rb:13:in `call'
18388
+ actionpack (4.2.6) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
18389
+ actionpack (4.2.6) lib/action_dispatch/middleware/flash.rb:260:in `call'
18390
+ rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
18391
+ rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
18392
+ actionpack (4.2.6) lib/action_dispatch/middleware/cookies.rb:560:in `call'
18393
+ activerecord (4.2.6) lib/active_record/query_cache.rb:36:in `call'
18394
+ activerecord (4.2.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
18395
+ activerecord (4.2.6) lib/active_record/migration.rb:377:in `call'
18396
+ actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
18397
+ activesupport (4.2.6) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
18398
+ activesupport (4.2.6) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
18399
+ activesupport (4.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks'
18400
+ actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
18401
+ actionpack (4.2.6) lib/action_dispatch/middleware/reloader.rb:73:in `call'
18402
+ actionpack (4.2.6) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
18403
+ actionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
18404
+ actionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
18405
+ railties (4.2.6) lib/rails/rack/logger.rb:38:in `call_app'
18406
+ railties (4.2.6) lib/rails/rack/logger.rb:20:in `block in call'
18407
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `block in tagged'
18408
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:26:in `tagged'
18409
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `tagged'
18410
+ railties (4.2.6) lib/rails/rack/logger.rb:20:in `call'
18411
+ actionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call'
18412
+ rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
18413
+ rack (1.6.4) lib/rack/runtime.rb:18:in `call'
18414
+ activesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
18415
+ rack (1.6.4) lib/rack/lock.rb:17:in `call'
18416
+ actionpack (4.2.6) lib/action_dispatch/middleware/static.rb:120:in `call'
18417
+ rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
18418
+ railties (4.2.6) lib/rails/engine.rb:518:in `call'
18419
+ railties (4.2.6) lib/rails/application.rb:165:in `call'
18420
+ rack (1.6.4) lib/rack/lock.rb:17:in `call'
18421
+ rack (1.6.4) lib/rack/content_length.rb:15:in `call'
18422
+ rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
18423
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
18424
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
18425
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
18426
+
18427
+
18428
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_source.erb (4.3ms)
18429
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.8ms)
18430
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (7.4ms)
18431
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (22.8ms)
18432
+
18433
+
18434
+ Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 17:34:33 +0300
18435
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
18436
+ Processing by LoginController#logout as HTML
18437
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."api_code" IS NULL LIMIT 1
18438
+  (0.1ms) begin transaction
18439
+  (0.0ms) commit transaction
18440
+ Completed 200 OK in 11ms (Views: 0.2ms | ActiveRecord: 0.5ms)
18441
+
18442
+
18443
+ Started GET "/login" for 127.0.0.1 at 2016-05-15 17:37:17 +0300
18444
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
18445
+ Processing by LoginController#index as HTML
18446
+ Rendered login/index.html.erb within layouts/application (2.1ms)
18447
+ Completed 200 OK in 136ms (Views: 136.2ms | ActiveRecord: 0.0ms)
18448
+
18449
+
18450
+ Started GET "/login/logout" for 127.0.0.1 at 2016-05-15 17:37:19 +0300
18451
+ Processing by LoginController#logout as HTML
18452
+ Completed 400 Bad Request in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms)
18453
+
18454
+
18455
+ Started GET "/__identify__" for 127.0.0.1 at 2016-05-15 17:44:19 +0300
18456
+
18457
+ ActionController::RoutingError (No route matches [GET] "/__identify__"):
18458
+ actionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
18459
+ actionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
18460
+ railties (4.2.6) lib/rails/rack/logger.rb:38:in `call_app'
18461
+ railties (4.2.6) lib/rails/rack/logger.rb:20:in `block in call'
18462
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `block in tagged'
18463
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:26:in `tagged'
18464
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `tagged'
18465
+ railties (4.2.6) lib/rails/rack/logger.rb:20:in `call'
18466
+ actionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call'
18467
+ rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
18468
+ rack (1.6.4) lib/rack/runtime.rb:18:in `call'
18469
+ activesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
18470
+ rack (1.6.4) lib/rack/lock.rb:17:in `call'
18471
+ actionpack (4.2.6) lib/action_dispatch/middleware/static.rb:120:in `call'
18472
+ rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
18473
+ railties (4.2.6) lib/rails/engine.rb:518:in `call'
18474
+ railties (4.2.6) lib/rails/application.rb:165:in `call'
18475
+ rack (1.6.4) lib/rack/lock.rb:17:in `call'
18476
+ rack (1.6.4) lib/rack/content_length.rb:15:in `call'
18477
+ rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
18478
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
18479
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
18480
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
18481
+
18482
+
18483
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.8ms)
18484
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/routes/_route.html.erb (1.6ms)
18485
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/routes/_table.html.erb (10.1ms)
18486
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.0ms)
18487
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout (44.8ms)
18488
+
18489
+
18490
+ Started GET "/__identify__" for 127.0.0.1 at 2016-05-15 17:44:20 +0300
18491
+
18492
+ ActionController::RoutingError (No route matches [GET] "/__identify__"):
18493
+ actionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
18494
+ actionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
18495
+ railties (4.2.6) lib/rails/rack/logger.rb:38:in `call_app'
18496
+ railties (4.2.6) lib/rails/rack/logger.rb:20:in `block in call'
18497
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `block in tagged'
18498
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:26:in `tagged'
18499
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `tagged'
18500
+ railties (4.2.6) lib/rails/rack/logger.rb:20:in `call'
18501
+ actionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call'
18502
+ rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
18503
+ rack (1.6.4) lib/rack/runtime.rb:18:in `call'
18504
+ activesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
18505
+ rack (1.6.4) lib/rack/lock.rb:17:in `call'
18506
+ actionpack (4.2.6) lib/action_dispatch/middleware/static.rb:120:in `call'
18507
+ rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
18508
+ railties (4.2.6) lib/rails/engine.rb:518:in `call'
18509
+ railties (4.2.6) lib/rails/application.rb:165:in `call'
18510
+ rack (1.6.4) lib/rack/lock.rb:17:in `call'
18511
+ rack (1.6.4) lib/rack/content_length.rb:15:in `call'
18512
+ rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
18513
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
18514
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
18515
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
18516
+
18517
+
18518
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.2ms)
18519
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/routes/_route.html.erb (0.8ms)
18520
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/routes/_table.html.erb (1.1ms)
18521
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.8ms)
18522
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout (15.7ms)
18523
+  (119.4ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
18524
+  (0.2ms) select sqlite_version(*)
18525
+  (73.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
18526
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
18527
+ Migrating to CreateTables (20160514163909)
18528
+  (0.2ms) begin transaction
18529
+  (0.7ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)
18530
+  (0.3ms) CREATE INDEX "index_users_on_name" ON "users" ("name")
18531
+  (0.4ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)
18532
+  (0.3ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) 
18533
+  (0.3ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name")
18534
+  (0.4ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer) 
18535
+  (0.3ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "users_group_id" integer, "url_id" integer)
18536
+ SQL (0.2ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]]
18537
+ SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]]
18538
+ SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]]
18539
+ SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]]
18540
+ SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]]
18541
+ SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]]
18542
+ SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]]
18543
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160514163909"]]
18544
+  (115.7ms) commit transaction
18545
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
18546
+  (0.3ms)  SELECT sql
18547
+ FROM sqlite_master
18548
+ WHERE name='index_user_groups_on_name' AND type='index'
18549
+ UNION ALL
18550
+ SELECT sql
18551
+ FROM sqlite_temp_master
18552
+ WHERE name='index_user_groups_on_name' AND type='index'
18553
+ 
18554
+  (0.3ms) SELECT sql
18555
+ FROM sqlite_master
18556
+ WHERE name='index_users_on_name' AND type='index'
18557
+ UNION ALL
18558
+ SELECT sql
18559
+ FROM sqlite_temp_master
18560
+ WHERE name='index_users_on_name' AND type='index'
18561
+
18562
+  (102.7ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
18563
+  (0.1ms) select sqlite_version(*)
18564
+  (99.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
18565
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
18566
+ Migrating to CreateTables (20160514163909)
18567
+  (0.1ms) begin transaction
18568
+  (0.4ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)
18569
+  (0.2ms) CREATE INDEX "index_users_on_name" ON "users" ("name")
18570
+  (0.2ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)
18571
+  (0.2ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) 
18572
+  (0.2ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name")
18573
+  (0.2ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer) 
18574
+  (0.2ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "users_group_id" integer, "url_id" integer)
18575
+ SQL (0.1ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]]
18576
+ SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]]
18577
+ SQL (0.0ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]]
18578
+ SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]]
18579
+ SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]]
18580
+ SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]]
18581
+ SQL (0.0ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]]
18582
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160514163909"]]
18583
+  (97.5ms) commit transaction
18584
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
18585
+  (0.3ms)  SELECT sql
18586
+ FROM sqlite_master
18587
+ WHERE name='index_user_groups_on_name' AND type='index'
18588
+ UNION ALL
18589
+ SELECT sql
18590
+ FROM sqlite_temp_master
18591
+ WHERE name='index_user_groups_on_name' AND type='index'
18592
+ 
18593
+  (0.3ms) SELECT sql
18594
+ FROM sqlite_master
18595
+ WHERE name='index_users_on_name' AND type='index'
18596
+ UNION ALL
18597
+ SELECT sql
18598
+ FROM sqlite_temp_master
18599
+ WHERE name='index_users_on_name' AND type='index'
18600
+
18601
+
18602
+
18603
+ Started GET "/login" for 127.0.0.1 at 2016-05-15 17:49:22 +0300
18604
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
18605
+ Processing by LoginController#index as HTML
18606
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."name" = ? LIMIT 1 [["name", "guest"]]
18607
+ SQL (0.2ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1
18608
+ Rendered login/index.html.erb within layouts/application (2.1ms)
18609
+ Completed 200 OK in 178ms (Views: 139.5ms | ActiveRecord: 1.0ms)
18610
+
18611
+
18612
+ Started GET "/__identify__" for 127.0.0.1 at 2016-05-15 17:49:52 +0300
18613
+
18614
+ ActionController::RoutingError (No route matches [GET] "/__identify__"):
18615
+ actionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
18616
+ actionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
18617
+ railties (4.2.6) lib/rails/rack/logger.rb:38:in `call_app'
18618
+ railties (4.2.6) lib/rails/rack/logger.rb:20:in `block in call'
18619
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `block in tagged'
18620
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:26:in `tagged'
18621
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `tagged'
18622
+ railties (4.2.6) lib/rails/rack/logger.rb:20:in `call'
18623
+ actionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call'
18624
+ rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
18625
+ rack (1.6.4) lib/rack/runtime.rb:18:in `call'
18626
+ activesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
18627
+ rack (1.6.4) lib/rack/lock.rb:17:in `call'
18628
+ actionpack (4.2.6) lib/action_dispatch/middleware/static.rb:120:in `call'
18629
+ rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
18630
+ railties (4.2.6) lib/rails/engine.rb:518:in `call'
18631
+ railties (4.2.6) lib/rails/application.rb:165:in `call'
18632
+ rack (1.6.4) lib/rack/lock.rb:17:in `call'
18633
+ rack (1.6.4) lib/rack/content_length.rb:15:in `call'
18634
+ rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
18635
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
18636
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
18637
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
18638
+
18639
+
18640
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.6ms)
18641
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/routes/_route.html.erb (0.9ms)
18642
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/routes/_table.html.erb (8.5ms)
18643
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.1ms)
18644
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout (38.5ms)
18645
+
18646
+
18647
+ Started GET "/__identify__" for 127.0.0.1 at 2016-05-15 17:49:52 +0300
18648
+
18649
+ ActionController::RoutingError (No route matches [GET] "/__identify__"):
18650
+ actionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
18651
+ actionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
18652
+ railties (4.2.6) lib/rails/rack/logger.rb:38:in `call_app'
18653
+ railties (4.2.6) lib/rails/rack/logger.rb:20:in `block in call'
18654
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `block in tagged'
18655
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:26:in `tagged'
18656
+ activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `tagged'
18657
+ railties (4.2.6) lib/rails/rack/logger.rb:20:in `call'
18658
+ actionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call'
18659
+ rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
18660
+ rack (1.6.4) lib/rack/runtime.rb:18:in `call'
18661
+ activesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
18662
+ rack (1.6.4) lib/rack/lock.rb:17:in `call'
18663
+ actionpack (4.2.6) lib/action_dispatch/middleware/static.rb:120:in `call'
18664
+ rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
18665
+ railties (4.2.6) lib/rails/engine.rb:518:in `call'
18666
+ railties (4.2.6) lib/rails/application.rb:165:in `call'
18667
+ rack (1.6.4) lib/rack/lock.rb:17:in `call'
18668
+ rack (1.6.4) lib/rack/content_length.rb:15:in `call'
18669
+ rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
18670
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
18671
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
18672
+ /home/dcrow/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
18673
+
18674
+
18675
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.3ms)
18676
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/routes/_route.html.erb (0.7ms)
18677
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/routes/_table.html.erb (1.0ms)
18678
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.8ms)
18679
+ Rendered /home/dcrow/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout (15.2ms)
18680
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
18681
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
18682
+  (0.1ms)  SELECT sql
18683
+ FROM sqlite_master
18684
+ WHERE name='index_user_groups_on_name' AND type='index'
18685
+ UNION ALL
18686
+ SELECT sql
18687
+ FROM sqlite_temp_master
18688
+ WHERE name='index_user_groups_on_name' AND type='index'
18689
+ 
18690
+  (0.1ms) SELECT sql
18691
+ FROM sqlite_master
18692
+ WHERE name='index_users_on_name' AND type='index'
18693
+ UNION ALL
18694
+ SELECT sql
18695
+ FROM sqlite_temp_master
18696
+ WHERE name='index_users_on_name' AND type='index'
18697
+
18698
+  (102.4ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
18699
+  (0.3ms) select sqlite_version(*)
18700
+  (97.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
18701
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
18702
+ Migrating to CreateTables (20160514163909)
18703
+  (0.1ms) begin transaction
18704
+  (0.7ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)
18705
+  (0.3ms) CREATE INDEX "index_users_on_name" ON "users" ("name")
18706
+  (0.3ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)
18707
+  (0.3ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) 
18708
+  (0.3ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name")
18709
+  (0.3ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer) 
18710
+  (0.3ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "users_group_id" integer, "url_id" integer)
18711
+ SQL (0.3ms) INSERT INTO "users" ("name", "id") VALUES (?, ?) [["name", "guest"], ["id", 1]]
18712
+ SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"], ["id", 1]]
18713
+ SQL (0.1ms) INSERT INTO "urls" ("url_pattern", "name", "http_method", "id") VALUES (?, ?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"], ["id", 2]]
18714
+ SQL (0.1ms) INSERT INTO "user_groups" ("id", "name") VALUES (?, ?) [["id", 1], ["name", "Guest"]]
18715
+ SQL (0.1ms) INSERT INTO "users_groups" ("id", "user_id", "user_group_id") VALUES (?, ?, ?) [["id", 1], ["user_id", 1], ["user_group_id", 1]]
18716
+ SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 1], ["url_id", 1], ["users_group_id", 1]]
18717
+ SQL (0.1ms) INSERT INTO "users_urls" ("id", "url_id", "users_group_id") VALUES (?, ?, ?) [["id", 2], ["url_id", 2], ["users_group_id", 1]]
18718
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160514163909"]]
18719
+  (115.8ms) commit transaction
18720
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
18721
+  (0.3ms)  SELECT sql
18722
+ FROM sqlite_master
18723
+ WHERE name='index_user_groups_on_name' AND type='index'
18724
+ UNION ALL
18725
+ SELECT sql
18726
+ FROM sqlite_temp_master
18727
+ WHERE name='index_user_groups_on_name' AND type='index'
18728
+ 
18729
+  (0.2ms) SELECT sql
18730
+ FROM sqlite_master
18731
+ WHERE name='index_users_on_name' AND type='index'
18732
+ UNION ALL
18733
+ SELECT sql
18734
+ FROM sqlite_temp_master
18735
+ WHERE name='index_users_on_name' AND type='index'
18736
+
18737
+  (0.1ms) begin transaction
18738
+ SQL (0.3ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]]
18739
+  (100.8ms) commit transaction
18740
+  (0.1ms) begin transaction
18741
+ SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]]
18742
+  (83.3ms) commit transaction
18743
+  (0.1ms) begin transaction
18744
+ SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]]
18745
+  (101.6ms) commit transaction
18746
+  (0.1ms) begin transaction
18747
+ SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]]
18748
+  (112.2ms) commit transaction
18749
+  (0.2ms) begin transaction
18750
+ SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 3], ["users_group_id", 2]]
18751
+  (98.3ms) commit transaction
18752
+ SQL (0.6ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2
18753
+ UsersGroup Load (0.4ms) SELECT "users_groups".* FROM "users_groups"
18754
+  (79.6ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
18755
+  (0.3ms) select sqlite_version(*)
18756
+  (107.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
18757
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
18758
+ Migrating to CreateTables (20160514163909)
18759
+  (0.2ms) begin transaction
18760
+  (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)
18761
+  (0.4ms) CREATE INDEX "index_users_on_name" ON "users" ("name")
18762
+  (0.4ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)
18763
+  (0.4ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) 
18764
+  (0.4ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name")
18765
+  (0.5ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer) 
18766
+  (0.4ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "users_group_id" integer, "url_id" integer)
18767
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160514163909"]]
18768
+  (104.8ms) commit transaction
18769
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
18770
+  (0.3ms) SELECT sql
18771
+ FROM sqlite_master
18772
+ WHERE name='index_user_groups_on_name' AND type='index'
18773
+ UNION ALL
18774
+ SELECT sql
18775
+ FROM sqlite_temp_master
18776
+ WHERE name='index_user_groups_on_name' AND type='index'
18777
+
18778
+  (0.3ms)  SELECT sql
18779
+ FROM sqlite_master
18780
+ WHERE name='index_users_on_name' AND type='index'
18781
+ UNION ALL
18782
+ SELECT sql
18783
+ FROM sqlite_temp_master
18784
+ WHERE name='index_users_on_name' AND type='index'
18785
+ 
18786
+  (0.1ms) begin transaction
18787
+ SQL (0.3ms) INSERT INTO "users" ("name") VALUES (?) [["name", "guest"]]
18788
+  (107.0ms) commit transaction
18789
+  (0.1ms) begin transaction
18790
+ SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"]]
18791
+  (97.3ms) commit transaction
18792
+  (0.2ms) begin transaction
18793
+ SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"]]
18794
+  (118.3ms) commit transaction
18795
+  (0.2ms) begin transaction
18796
+ SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login/logout"], ["name", "Logout page"], ["http_method", "GET"]]
18797
+  (85.2ms) commit transaction
18798
+  (0.1ms) begin transaction
18799
+ SQL (0.5ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Guest"]]
18800
+  (110.4ms) commit transaction
18801
+  (0.2ms) begin transaction
18802
+ SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 1], ["user_group_id", 1]]
18803
+  (117.6ms) commit transaction
18804
+  (0.1ms) begin transaction
18805
+ SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 1], ["users_group_id", 1]]
18806
+  (107.7ms) commit transaction
18807
+  (0.2ms) begin transaction
18808
+ SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 2], ["users_group_id", 1]]
18809
+  (104.4ms) commit transaction
18810
+  (0.2ms) begin transaction
18811
+ SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 3], ["users_group_id", 1]]
18812
+  (97.1ms) commit transaction
18813
+  (0.1ms) begin transaction
18814
+ SQL (0.3ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]]
18815
+  (101.6ms) commit transaction
18816
+  (0.1ms) begin transaction
18817
+ SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]]
18818
+  (101.1ms) commit transaction
18819
+  (0.1ms) begin transaction
18820
+ SQL (0.2ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]]
18821
+  (102.7ms) commit transaction
18822
+  (0.1ms) begin transaction
18823
+ SQL (0.2ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 1]]
18824
+  (93.6ms) commit transaction
18825
+  (0.2ms) begin transaction
18826
+ SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]]
18827
+  (106.4ms) commit transaction
18828
+  (0.2ms) begin transaction
18829
+ SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 4], ["users_group_id", 2]]
18830
+  (105.1ms) commit transaction
18831
+  (0.2ms) begin transaction
18832
+ SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 4], ["users_group_id", 3]]
18833
+  (107.3ms) commit transaction
18834
+ SQL (0.7ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."users_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "users_groups"."id" AS t2_r0, "users_groups"."user_group_id" AS t2_r1, "users_groups"."user_id" AS t2_r2, "users"."id" AS t3_r0, "users"."name" AS t3_r1, "users"."api_code" AS t3_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "users_groups" ON "users_groups"."id" = "users_urls"."users_group_id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2
18835
+ UserGroup Load (0.5ms) SELECT "user_groups".* FROM "user_groups"
18836
+ UsersGroup Load (0.4ms) SELECT "users_groups".* FROM "users_groups"
18837
+  (88.1ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
18838
+  (0.3ms) select sqlite_version(*)
18839
+  (114.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
18840
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
18841
+ Migrating to CreateTables (20160514163909)
18842
+  (0.2ms) begin transaction
18843
+  (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)
18844
+  (0.4ms) CREATE INDEX "index_users_on_name" ON "users" ("name")
18845
+  (0.4ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)
18846
+  (0.4ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) 
18847
+  (0.4ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name")
18848
+  (0.4ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer) 
18849
+  (0.4ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "users_group_id" integer, "url_id" integer)
18850
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160514163909"]]
18851
+  (98.3ms) commit transaction
18852
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
18853
+  (0.4ms) SELECT sql
18854
+ FROM sqlite_master
18855
+ WHERE name='index_user_groups_on_name' AND type='index'
18856
+ UNION ALL
18857
+ SELECT sql
18858
+ FROM sqlite_temp_master
18859
+ WHERE name='index_user_groups_on_name' AND type='index'
18860
+
18861
+  (0.3ms)  SELECT sql
18862
+ FROM sqlite_master
18863
+ WHERE name='index_users_on_name' AND type='index'
18864
+ UNION ALL
18865
+ SELECT sql
18866
+ FROM sqlite_temp_master
18867
+ WHERE name='index_users_on_name' AND type='index'
18868
+ 
18869
+  (0.1ms) begin transaction
18870
+ SQL (0.3ms) INSERT INTO "users" ("name") VALUES (?) [["name", "guest"]]
18871
+  (105.7ms) commit transaction
18872
+  (0.1ms) begin transaction
18873
+ SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"]]
18874
+  (102.0ms) commit transaction
18875
+  (0.2ms) begin transaction
18876
+ SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"]]
18877
+  (102.8ms) commit transaction
18878
+  (0.2ms) begin transaction
18879
+ SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login/logout"], ["name", "Logout page"], ["http_method", "GET"]]
18880
+  (86.2ms) commit transaction
18881
+  (0.1ms) begin transaction
18882
+ SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Guest"]]
18883
+  (83.9ms) commit transaction
18884
+  (0.1ms) begin transaction
18885
+ SQL (0.3ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 1], ["user_group_id", 1]]
18886
+  (98.9ms) commit transaction
18887
+  (0.2ms) begin transaction
18888
+ SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 1], ["users_group_id", 1]]
18889
+  (96.5ms) commit transaction
18890
+  (0.1ms) begin transaction
18891
+ SQL (0.3ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 2], ["users_group_id", 1]]
18892
+  (100.3ms) commit transaction
18893
+  (0.2ms) begin transaction
18894
+ SQL (0.4ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 3], ["users_group_id", 1]]
18895
+  (98.3ms) commit transaction
18896
+  (0.2ms) begin transaction
18897
+ SQL (0.4ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]]
18898
+  (98.0ms) commit transaction
18899
+  (0.2ms) begin transaction
18900
+ SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]]
18901
+  (100.7ms) commit transaction
18902
+  (0.1ms) begin transaction
18903
+ SQL (0.3ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]]
18904
+  (89.6ms) commit transaction
18905
+  (0.2ms) begin transaction
18906
+ SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 1]]
18907
+  (102.2ms) commit transaction
18908
+  (0.2ms) begin transaction
18909
+ SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]]
18910
+  (85.8ms) commit transaction
18911
+  (0.2ms) begin transaction
18912
+ SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "users_group_id") VALUES (?, ?) [["url_id", 4], ["users_group_id", 2]]
18913
+  (102.8ms) commit transaction
18914
+  (87.7ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
18915
+  (0.3ms) select sqlite_version(*)
18916
+  (97.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
18917
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
18918
+ Migrating to CreateTables (20160514163909)
18919
+  (0.2ms) begin transaction
18920
+  (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)
18921
+  (0.4ms) CREATE INDEX "index_users_on_name" ON "users" ("name")
18922
+  (0.4ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)
18923
+  (0.4ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) 
18924
+  (0.4ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name")
18925
+  (0.4ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer) 
18926
+  (0.4ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "url_id" integer)
18927
+ SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160514163909"]]
18928
+  (122.2ms) commit transaction
18929
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
18930
+  (0.4ms) SELECT sql
18931
+ FROM sqlite_master
18932
+ WHERE name='index_user_groups_on_name' AND type='index'
18933
+ UNION ALL
18934
+ SELECT sql
18935
+ FROM sqlite_temp_master
18936
+ WHERE name='index_user_groups_on_name' AND type='index'
18937
+
18938
+  (0.3ms)  SELECT sql
18939
+ FROM sqlite_master
18940
+ WHERE name='index_users_on_name' AND type='index'
18941
+ UNION ALL
18942
+ SELECT sql
18943
+ FROM sqlite_temp_master
18944
+ WHERE name='index_users_on_name' AND type='index'
18945
+ 
18946
+  (0.1ms) begin transaction
18947
+ SQL (0.3ms) INSERT INTO "users" ("name") VALUES (?) [["name", "guest"]]
18948
+  (106.5ms) commit transaction
18949
+  (0.1ms) begin transaction
18950
+ SQL (0.4ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"]]
18951
+  (112.8ms) commit transaction
18952
+  (0.2ms) begin transaction
18953
+ SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"]]
18954
+  (96.1ms) commit transaction
18955
+  (0.1ms) begin transaction
18956
+ SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login/logout"], ["name", "Logout page"], ["http_method", "GET"]]
18957
+  (105.1ms) commit transaction
18958
+  (0.1ms) begin transaction
18959
+ SQL (0.3ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Guest"]]
18960
+  (119.7ms) commit transaction
18961
+  (0.1ms) begin transaction
18962
+ SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 1], ["user_group_id", 1]]
18963
+  (92.0ms) commit transaction
18964
+  (0.2ms) begin transaction
18965
+ SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 1], ["user_group_id", 1]]
18966
+  (88.2ms) commit transaction
18967
+  (0.1ms) begin transaction
18968
+ SQL (0.2ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 2], ["user_group_id", 1]]
18969
+  (84.8ms) commit transaction
18970
+  (0.2ms) begin transaction
18971
+ SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 3], ["user_group_id", 1]]
18972
+  (98.7ms) commit transaction
18973
+ SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1
18974
+  (0.2ms) begin transaction
18975
+ SQL (0.6ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]]
18976
+  (101.0ms) commit transaction
18977
+  (0.2ms) begin transaction
18978
+ SQL (0.6ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]]
18979
+  (94.2ms) commit transaction
18980
+  (0.2ms) begin transaction
18981
+ SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]]
18982
+  (104.0ms) commit transaction
18983
+  (0.2ms) begin transaction
18984
+ SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]]
18985
+  (90.1ms) commit transaction
18986
+  (0.2ms) begin transaction
18987
+ SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 4], ["user_group_id", 2]]
18988
+  (88.5ms) commit transaction
18989
+ SQL (1.0ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 1
18990
+ SQL (0.9ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2
18991
+ User Load (0.1ms) SELECT "users".* FROM "users"
18992
+ User Load (0.5ms) SELECT "users".* FROM "users" INNER JOIN "users_groups" ON "users_groups"."user_id" = "users"."id"
18993
+ User Load (0.5ms) SELECT "users".* FROM "users" INNER JOIN "users_groups" ON "users_groups"."user_id" = "users"."id"
18994
+  (0.1ms) begin transaction
18995
+ SQL (0.3ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 1]]
18996
+  (96.3ms) commit transaction
18997
+ SQL (0.4ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2
18998
+  (116.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
18999
+  (0.2ms) select sqlite_version(*)
19000
+  (98.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
19001
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
19002
+ Migrating to CreateTables (20160514163909)
19003
+  (0.1ms) begin transaction
19004
+  (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)
19005
+  (0.3ms) CREATE INDEX "index_users_on_name" ON "users" ("name")
19006
+  (0.3ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)
19007
+  (0.4ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) 
19008
+  (0.4ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name")
19009
+  (0.4ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer) 
19010
+  (0.4ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "url_id" integer)
19011
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160514163909"]]
19012
+  (98.7ms) commit transaction
19013
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
19014
+  (0.3ms) SELECT sql
19015
+ FROM sqlite_master
19016
+ WHERE name='index_user_groups_on_name' AND type='index'
19017
+ UNION ALL
19018
+ SELECT sql
19019
+ FROM sqlite_temp_master
19020
+ WHERE name='index_user_groups_on_name' AND type='index'
19021
+
19022
+  (0.2ms)  SELECT sql
19023
+ FROM sqlite_master
19024
+ WHERE name='index_users_on_name' AND type='index'
19025
+ UNION ALL
19026
+ SELECT sql
19027
+ FROM sqlite_temp_master
19028
+ WHERE name='index_users_on_name' AND type='index'
19029
+ 
19030
+  (0.1ms) begin transaction
19031
+ SQL (0.4ms) INSERT INTO "users" ("name") VALUES (?) [["name", "guest"]]
19032
+  (99.7ms) commit transaction
19033
+  (0.0ms) begin transaction
19034
+ SQL (0.2ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login"], ["name", "Login page"], ["http_method", "GET"]]
19035
+  (107.1ms) commit transaction
19036
+  (0.1ms) begin transaction
19037
+ SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/oauth/.*"], ["name", "AuthCallback page"], ["http_method", "GET"]]
19038
+  (97.9ms) commit transaction
19039
+  (0.1ms) begin transaction
19040
+ SQL (0.3ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/login/logout"], ["name", "Logout page"], ["http_method", "GET"]]
19041
+  (96.5ms) commit transaction
19042
+  (0.1ms) begin transaction
19043
+ SQL (0.4ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Guest"]]
19044
+  (100.8ms) commit transaction
19045
+  (0.1ms) begin transaction
19046
+ SQL (0.5ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 1], ["user_group_id", 1]]
19047
+  (98.3ms) commit transaction
19048
+  (0.1ms) begin transaction
19049
+ SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 1], ["user_group_id", 1]]
19050
+  (96.5ms) commit transaction
19051
+  (0.1ms) begin transaction
19052
+ SQL (0.3ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 2], ["user_group_id", 1]]
19053
+  (82.7ms) commit transaction
19054
+  (0.1ms) begin transaction
19055
+ SQL (0.3ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 3], ["user_group_id", 1]]
19056
+  (117.5ms) commit transaction
19057
+  (0.2ms) begin transaction
19058
+ SQL (0.5ms) INSERT INTO "users" ("name") VALUES (?) [["name", "bar555@yandex.ru"]]
19059
+  (114.2ms) commit transaction
19060
+  (0.1ms) begin transaction
19061
+ SQL (0.3ms) INSERT INTO "user_groups" ("name") VALUES (?) [["name", "Test"]]
19062
+  (119.8ms) commit transaction
19063
+  (0.2ms) begin transaction
19064
+ SQL (0.4ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 2]]
19065
+  (194.3ms) commit transaction
19066
+  (0.1ms) begin transaction
19067
+ SQL (0.3ms) INSERT INTO "users_groups" ("user_id", "user_group_id") VALUES (?, ?) [["user_id", 2], ["user_group_id", 1]]
19068
+  (115.2ms) commit transaction
19069
+  (0.2ms) begin transaction
19070
+ SQL (0.5ms) INSERT INTO "urls" ("url_pattern", "name", "http_method") VALUES (?, ?, ?) [["url_pattern", "^/test"], ["name", "Test page"], ["http_method", "GET"]]
19071
+  (119.1ms) commit transaction
19072
+  (0.2ms) begin transaction
19073
+ SQL (0.5ms) INSERT INTO "users_urls" ("url_id", "user_group_id") VALUES (?, ?) [["url_id", 4], ["user_group_id", 2]]
19074
+  (93.1ms) commit transaction
19075
+ SQL (0.8ms) SELECT "urls"."id" AS t0_r0, "urls"."url_pattern" AS t0_r1, "urls"."name" AS t0_r2, "urls"."http_method" AS t0_r3, "users_urls"."id" AS t1_r0, "users_urls"."user_group_id" AS t1_r1, "users_urls"."url_id" AS t1_r2, "user_groups"."id" AS t2_r0, "user_groups"."name" AS t2_r1, "users_groups"."id" AS t3_r0, "users_groups"."user_group_id" AS t3_r1, "users_groups"."user_id" AS t3_r2, "users"."id" AS t4_r0, "users"."name" AS t4_r1, "users"."api_code" AS t4_r2 FROM "urls" LEFT OUTER JOIN "users_urls" ON "users_urls"."url_id" = "urls"."id" LEFT OUTER JOIN "user_groups" ON "user_groups"."id" = "users_urls"."user_group_id" LEFT OUTER JOIN "users_groups" ON "users_groups"."user_group_id" = "user_groups"."id" LEFT OUTER JOIN "users" ON "users"."id" = "users_groups"."user_id" WHERE "users_groups"."user_id" = 2
19076
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
19077
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
19078
+  (0.1ms)  SELECT sql
19079
+ FROM sqlite_master
19080
+ WHERE name='index_user_groups_on_name' AND type='index'
19081
+ UNION ALL
19082
+ SELECT sql
19083
+ FROM sqlite_temp_master
19084
+ WHERE name='index_user_groups_on_name' AND type='index'
19085
+ 
19086
+  (0.1ms) SELECT sql
19087
+ FROM sqlite_master
19088
+ WHERE name='index_users_on_name' AND type='index'
19089
+ UNION ALL
19090
+ SELECT sql
19091
+ FROM sqlite_temp_master
19092
+ WHERE name='index_users_on_name' AND type='index'
19093
+
19094
+  (104.4ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
19095
+  (0.3ms) select sqlite_version(*)
19096
+  (97.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
19097
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
19098
+ Migrating to CreateTables (20160514163909)
19099
+  (0.1ms) begin transaction
19100
+  (0.5ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)
19101
+  (0.2ms) CREATE INDEX "index_users_on_name" ON "users" ("name")
19102
+  (0.2ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)
19103
+  (0.2ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) 
19104
+  (0.2ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name")
19105
+  (0.2ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer) 
19106
+  (0.2ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "url_id" integer)
19107
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160514163909"]]
19108
+  (98.7ms) commit transaction
19109
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
19110
+  (0.2ms) SELECT sql
19111
+ FROM sqlite_master
19112
+ WHERE name='index_user_groups_on_name' AND type='index'
19113
+ UNION ALL
19114
+ SELECT sql
19115
+ FROM sqlite_temp_master
19116
+ WHERE name='index_user_groups_on_name' AND type='index'
19117
+
19118
+  (0.2ms)  SELECT sql
19119
+ FROM sqlite_master
19120
+ WHERE name='index_users_on_name' AND type='index'
19121
+ UNION ALL
19122
+ SELECT sql
19123
+ FROM sqlite_temp_master
19124
+ WHERE name='index_users_on_name' AND type='index'
19125
+ 
19126
+  (99.8ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
19127
+  (0.1ms) select sqlite_version(*)
19128
+  (99.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
19129
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
19130
+ Migrating to CreateTables (20160514163909)
19131
+  (0.1ms) begin transaction
19132
+  (0.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "api_code" varchar)
19133
+  (0.4ms) CREATE INDEX "index_users_on_name" ON "users" ("name")
19134
+  (0.4ms) CREATE TABLE "urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "url_pattern" varchar, "name" varchar, "http_method" varchar)
19135
+  (0.4ms) CREATE TABLE "user_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) 
19136
+  (0.4ms) CREATE INDEX "index_user_groups_on_name" ON "user_groups" ("name")
19137
+  (0.4ms) CREATE TABLE "users_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "user_id" integer) 
19138
+  (0.4ms) CREATE TABLE "users_urls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_group_id" integer, "url_id" integer)
19139
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160514163909"]]
19140
+  (97.1ms) commit transaction
19141
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
19142
+  (0.2ms) SELECT sql
19143
+ FROM sqlite_master
19144
+ WHERE name='index_user_groups_on_name' AND type='index'
19145
+ UNION ALL
19146
+ SELECT sql
19147
+ FROM sqlite_temp_master
19148
+ WHERE name='index_user_groups_on_name' AND type='index'
19149
+
19150
+  (0.2ms)  SELECT sql
19151
+ FROM sqlite_master
19152
+ WHERE name='index_users_on_name' AND type='index'
19153
+ UNION ALL
19154
+ SELECT sql
19155
+ FROM sqlite_temp_master
19156
+ WHERE name='index_users_on_name' AND type='index'
19157
+