acts_as_nested_interval 0.1.1 → 0.2.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/lib/acts_as_nested_interval.rb +42 -41
  3. data/lib/acts_as_nested_interval/callbacks.rb +42 -0
  4. data/lib/acts_as_nested_interval/class_methods.rb +2 -2
  5. data/lib/acts_as_nested_interval/instance_methods.rb +13 -33
  6. data/lib/acts_as_nested_interval/version.rb +1 -1
  7. data/test/dummy/README.rdoc +15 -248
  8. data/test/dummy/Rakefile +1 -2
  9. data/test/dummy/app/assets/javascripts/application.js +3 -5
  10. data/test/dummy/app/assets/stylesheets/application.css +6 -4
  11. data/test/dummy/app/controllers/application_controller.rb +3 -1
  12. data/test/dummy/app/models/region.rb +2 -0
  13. data/test/dummy/app/views/layouts/application.html.erb +2 -2
  14. data/test/dummy/bin/bundle +3 -0
  15. data/test/dummy/bin/rails +4 -0
  16. data/test/dummy/bin/rake +4 -0
  17. data/test/dummy/config.ru +1 -1
  18. data/test/dummy/config/application.rb +1 -34
  19. data/test/dummy/config/boot.rb +4 -9
  20. data/test/dummy/config/database.yml +1 -1
  21. data/test/dummy/config/environment.rb +3 -3
  22. data/test/dummy/config/environments/development.rb +19 -19
  23. data/test/dummy/config/environments/production.rb +44 -28
  24. data/test/dummy/config/environments/test.rb +17 -15
  25. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  26. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  27. data/test/dummy/config/initializers/inflections.rb +6 -5
  28. data/test/dummy/config/initializers/mime_types.rb +0 -1
  29. data/test/dummy/config/initializers/session_store.rb +1 -6
  30. data/test/dummy/config/initializers/wrap_parameters.rb +6 -6
  31. data/test/dummy/config/locales/en.yml +20 -2
  32. data/test/dummy/config/routes.rb +23 -25
  33. data/test/dummy/config/secrets.yml +22 -0
  34. data/test/dummy/db/schema.rb +14 -11
  35. data/test/dummy/log/development.log +17 -0
  36. data/test/dummy/log/test.log +2833 -0
  37. data/test/dummy/public/404.html +54 -13
  38. data/test/dummy/public/422.html +54 -13
  39. data/test/dummy/public/500.html +53 -12
  40. data/test/dummy_bak/Gemfile +4 -0
  41. data/test/dummy_bak/Gemfile.lock +92 -0
  42. data/test/dummy_bak/README.rdoc +261 -0
  43. data/test/dummy_bak/Rakefile +7 -0
  44. data/test/dummy_bak/app/assets/javascripts/application.js +15 -0
  45. data/test/dummy_bak/app/assets/stylesheets/application.css +13 -0
  46. data/test/dummy_bak/app/controllers/application_controller.rb +3 -0
  47. data/test/dummy_bak/app/helpers/application_helper.rb +2 -0
  48. data/test/dummy_bak/app/models/region.rb +5 -0
  49. data/test/dummy_bak/app/views/layouts/application.html.erb +14 -0
  50. data/test/dummy_bak/bin/bundle +3 -0
  51. data/test/dummy_bak/bin/rails +4 -0
  52. data/test/dummy_bak/bin/rake +4 -0
  53. data/test/dummy_bak/config.ru +4 -0
  54. data/test/dummy_bak/config/application.rb +23 -0
  55. data/test/dummy_bak/config/boot.rb +4 -0
  56. data/test/dummy_bak/config/database.yml +31 -0
  57. data/test/dummy_bak/config/environment.rb +5 -0
  58. data/test/dummy_bak/config/environments/development.rb +37 -0
  59. data/test/dummy_bak/config/environments/production.rb +83 -0
  60. data/test/dummy_bak/config/environments/test.rb +39 -0
  61. data/test/dummy_bak/config/initializers/backtrace_silencers.rb +7 -0
  62. data/test/dummy_bak/config/initializers/cookies_serializer.rb +3 -0
  63. data/test/dummy_bak/config/initializers/filter_parameter_logging.rb +4 -0
  64. data/test/dummy_bak/config/initializers/inflections.rb +16 -0
  65. data/test/dummy_bak/config/initializers/mime_types.rb +4 -0
  66. data/test/{dummy → dummy_bak}/config/initializers/secret_token.rb +0 -0
  67. data/test/dummy_bak/config/initializers/session_store.rb +3 -0
  68. data/test/dummy_bak/config/initializers/wrap_parameters.rb +14 -0
  69. data/test/dummy_bak/config/locales/en.yml +23 -0
  70. data/test/dummy_bak/config/routes.rb +56 -0
  71. data/test/dummy_bak/config/secrets.yml +22 -0
  72. data/test/dummy_bak/db/development.sqlite3 +0 -0
  73. data/test/dummy_bak/db/migrate/20120302143528_create_regions.rb +15 -0
  74. data/test/dummy_bak/db/migrate/20121004204252_change_interval_precision.rb +6 -0
  75. data/test/dummy_bak/db/schema.rb +28 -0
  76. data/test/dummy_bak/log/development.log +229 -0
  77. data/test/dummy_bak/log/test.log +0 -0
  78. data/test/dummy_bak/public/404.html +26 -0
  79. data/test/dummy_bak/public/422.html +26 -0
  80. data/test/dummy_bak/public/500.html +25 -0
  81. data/test/dummy_bak/public/favicon.ico +0 -0
  82. data/test/{dummy → dummy_bak}/script/rails +0 -0
  83. data/test/{dummy → dummy_bak}/test/fixtures/regions.yml +0 -0
  84. data/test/{dummy → dummy_bak}/test/unit/region_test.rb +0 -0
  85. data/test/test_helper.rb +5 -0
  86. metadata +112 -55
@@ -2,4 +2,3 @@
2
2
 
3
3
  # Add new mime types for use in respond_to blocks:
4
4
  # Mime::Type.register "text/richtext", :rtf
5
- # Mime::Type.register_alias "text/html", :iphone
@@ -1,8 +1,3 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
-
5
- # Use the database for sessions instead of the cookie-based default,
6
- # which shouldn't be used to store highly confidential information
7
- # (create the session table with "rails generate session_migration")
8
- # Dummy::Application.config.session_store :active_record_store
3
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session'
@@ -1,14 +1,14 @@
1
1
  # Be sure to restart your server when you modify this file.
2
- #
2
+
3
3
  # This file contains settings for ActionController::ParamsWrapper which
4
4
  # is enabled by default.
5
5
 
6
6
  # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
7
  ActiveSupport.on_load(:action_controller) do
8
- wrap_parameters format: [:json]
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
9
  end
10
10
 
11
- # Disable root element in JSON by default.
12
- ActiveSupport.on_load(:active_record) do
13
- self.include_root_in_json = false
14
- end
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -1,5 +1,23 @@
1
- # Sample localization file for English. Add more files in this directory for other locales.
2
- # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
3
21
 
4
22
  en:
5
23
  hello: "Hello world"
@@ -1,19 +1,20 @@
1
- Dummy::Application.routes.draw do
2
- # The priority is based upon order of creation:
3
- # first created -> highest priority.
1
+ Rails.application.routes.draw do
2
+ # The priority is based upon order of creation: first created -> highest priority.
3
+ # See how all your routes lay out with "rake routes".
4
4
 
5
- # Sample of regular route:
6
- # match 'products/:id' => 'catalog#view'
7
- # Keep in mind you can assign values other than :controller and :action
5
+ # You can have the root of your site routed with "root"
6
+ # root 'welcome#index'
7
+
8
+ # Example of regular route:
9
+ # get 'products/:id' => 'catalog#view'
8
10
 
9
- # Sample of named route:
10
- # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
11
- # This route can be invoked with purchase_url(:id => product.id)
11
+ # Example of named route that can be invoked with purchase_url(id: product.id)
12
+ # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
12
13
 
13
- # Sample resource route (maps HTTP verbs to controller actions automatically):
14
+ # Example resource route (maps HTTP verbs to controller actions automatically):
14
15
  # resources :products
15
16
 
16
- # Sample resource route with options:
17
+ # Example resource route with options:
17
18
  # resources :products do
18
19
  # member do
19
20
  # get 'short'
@@ -25,34 +26,31 @@ Dummy::Application.routes.draw do
25
26
  # end
26
27
  # end
27
28
 
28
- # Sample resource route with sub-resources:
29
+ # Example resource route with sub-resources:
29
30
  # resources :products do
30
31
  # resources :comments, :sales
31
32
  # resource :seller
32
33
  # end
33
34
 
34
- # Sample resource route with more complex sub-resources
35
+ # Example resource route with more complex sub-resources:
35
36
  # resources :products do
36
37
  # resources :comments
37
38
  # resources :sales do
38
- # get 'recent', :on => :collection
39
+ # get 'recent', on: :collection
39
40
  # end
40
41
  # end
41
42
 
42
- # Sample resource route within a namespace:
43
+ # Example resource route with concerns:
44
+ # concern :toggleable do
45
+ # post 'toggle'
46
+ # end
47
+ # resources :posts, concerns: :toggleable
48
+ # resources :photos, concerns: :toggleable
49
+
50
+ # Example resource route within a namespace:
43
51
  # namespace :admin do
44
52
  # # Directs /admin/products/* to Admin::ProductsController
45
53
  # # (app/controllers/admin/products_controller.rb)
46
54
  # resources :products
47
55
  # end
48
-
49
- # You can have the root of your site routed with "root"
50
- # just remember to delete public/index.html.
51
- # root :to => 'welcome#index'
52
-
53
- # See how all your routes lay out with "rake routes"
54
-
55
- # This is a legacy wild controller route that's not recommended for RESTful applications.
56
- # Note: This route will make all actions in every controller accessible via GET requests.
57
- # match ':controller(/:action(/:id))(.:format)'
58
56
  end
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: 0f5407a1dccb137d3cfa772f4c768b9b8fb8e5ab815dafdd6922142803554698a7e762fa9fbcd4a4efd23fa0fbff85b2c6f7edae3fee29d8a9feae95584e02f7
15
+
16
+ test:
17
+ secret_key_base: e9dfe3af2a97f3632efa98b8d556c62013cb9319b814a0322980530c80b4e5b296d228812c029b86a9800aa66166965a2b9dfb64a1308460cb5daede9819071e
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -9,20 +9,23 @@
9
9
  # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
10
  # you'll amass, the slower it'll run and the greater likelihood for issues).
11
11
  #
12
- # It's strongly recommended to check this file into your version control system.
12
+ # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20121004204252) do
14
+ ActiveRecord::Schema.define(version: 20121004204252) do
15
15
 
16
- create_table "regions", :force => true do |t|
17
- t.boolean "fiction", :default => false, :null => false
16
+ # These are extensions that must be enabled in order to support this database
17
+ enable_extension "plpgsql"
18
+
19
+ create_table "regions", force: true do |t|
20
+ t.boolean "fiction", default: false, null: false
18
21
  t.integer "region_id"
19
- t.integer "lftp", :null => false
20
- t.integer "lftq", :null => false
21
- t.integer "rgtp", :null => false
22
- t.integer "rgtq", :null => false
23
- t.decimal "lft", :precision => 31, :scale => 30, :null => false
24
- t.decimal "rgt", :precision => 31, :scale => 30, :null => false
25
- t.string "name", :null => false
22
+ t.integer "lftp", null: false
23
+ t.integer "lftq", null: false
24
+ t.integer "rgtp", null: false
25
+ t.integer "rgtq", null: false
26
+ t.decimal "lft", precision: 31, scale: 30, null: false
27
+ t.decimal "rgt", precision: 31, scale: 30, null: false
28
+ t.string "name", null: false
26
29
  end
27
30
 
28
31
  end
@@ -0,0 +1,17 @@
1
+  (43.4ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) 
2
+  (61.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3
+ ActiveRecord::SchemaMigration Load (2.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
4
+ Migrating to CreateRegions (20120302143528)
5
+  (0.6ms) BEGIN
6
+  (53.8ms) CREATE TABLE "regions" ("id" serial primary key, "fiction" boolean DEFAULT 'f' NOT NULL, "region_id" integer, "lftp" integer NOT NULL, "lftq" integer NOT NULL, "rgtp" integer NOT NULL, "rgtq" integer NOT NULL, "lft" float NOT NULL, "rgt" float NOT NULL, "name" character varying(255) NOT NULL) 
7
+ SQL (1.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20120302143528"]]
8
+  (12.3ms) COMMIT
9
+ Migrating to ChangeIntervalPrecision (20121004204252)
10
+  (0.7ms) BEGIN
11
+  (98.2ms) ALTER TABLE "regions" ALTER COLUMN "lft" TYPE decimal(31,30)
12
+  (0.7ms) ALTER TABLE "regions" ALTER "lft" SET NOT NULL
13
+  (80.3ms) ALTER TABLE "regions" ALTER COLUMN "rgt" TYPE decimal(31,30)
14
+  (0.7ms) ALTER TABLE "regions" ALTER "rgt" SET NOT NULL
15
+ SQL (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20121004204252"]]
16
+  (17.3ms) COMMIT
17
+ ActiveRecord::SchemaMigration Load (0.9ms) SELECT "schema_migrations".* FROM "schema_migrations"
@@ -0,0 +1,2833 @@
1
+  (24.3ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) 
2
+  (59.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3
+ ActiveRecord::SchemaMigration Load (2.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
4
+ Migrating to CreateRegions (20120302143528)
5
+  (0.6ms) BEGIN
6
+  (50.9ms) CREATE TABLE "regions" ("id" serial primary key, "fiction" boolean DEFAULT 'f' NOT NULL, "region_id" integer, "lftp" integer NOT NULL, "lftq" integer NOT NULL, "rgtp" integer NOT NULL, "rgtq" integer NOT NULL, "lft" float NOT NULL, "rgt" float NOT NULL, "name" character varying(255) NOT NULL) 
7
+ SQL (1.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20120302143528"]]
8
+  (20.9ms) COMMIT
9
+ Migrating to ChangeIntervalPrecision (20121004204252)
10
+  (0.8ms) BEGIN
11
+  (75.3ms) ALTER TABLE "regions" ALTER COLUMN "lft" TYPE decimal(31,30)
12
+  (0.7ms) ALTER TABLE "regions" ALTER "lft" SET NOT NULL
13
+  (74.7ms) ALTER TABLE "regions" ALTER COLUMN "rgt" TYPE decimal(31,30)
14
+  (0.8ms) ALTER TABLE "regions" ALTER "rgt" SET NOT NULL
15
+ SQL (1.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20121004204252"]]
16
+  (18.0ms) COMMIT
17
+ ActiveRecord::SchemaMigration Load (1.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
18
+ ActiveRecord::SchemaMigration Load (1.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
19
+  (0.6ms) BEGIN
20
+ ----------------------------------------
21
+ ActsAsNestedIntervalTest: test_ancestors
22
+ ----------------------------------------
23
+  (0.6ms) SAVEPOINT active_record_1
24
+ SQL (2.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
25
+  (0.6ms) RELEASE SAVEPOINT active_record_1
26
+  (0.6ms) SAVEPOINT active_record_1
27
+ Region Load (2.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 1]]
28
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 1]]
29
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 1], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
30
+  (1.0ms) RELEASE SAVEPOINT active_record_1
31
+  (0.6ms) SAVEPOINT active_record_1
32
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 2]]
33
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 2]]
34
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 2], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
35
+  (0.6ms) RELEASE SAVEPOINT active_record_1
36
+  (0.5ms) SAVEPOINT active_record_1
37
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 2]]
38
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 2]]
39
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 2], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
40
+  (0.6ms) RELEASE SAVEPOINT active_record_1
41
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (0 = 1)
42
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (0 = 1 OR lftq = 1 AND lftp = 0)
43
+ Region Load (2.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (0 = 1 OR lftq = 2 AND lftp = 1 OR lftq = 1 AND lftp = 0)
44
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (0 = 1 OR lftq = 2 AND lftp = 1 OR lftq = 1 AND lftp = 0)
45
+  (1.1ms) ROLLBACK
46
+  (0.5ms) BEGIN
47
+ -------------------------------------------
48
+ ActsAsNestedIntervalTest: test_append_child
49
+ -------------------------------------------
50
+  (0.5ms) SAVEPOINT active_record_1
51
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
52
+  (0.5ms) RELEASE SAVEPOINT active_record_1
53
+  (0.7ms) SAVEPOINT active_record_1
54
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 5]]
55
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 5]]
56
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 5]]
57
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 5], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
58
+  (0.6ms) RELEASE SAVEPOINT active_record_1
59
+  (0.7ms) ROLLBACK
60
+  (0.5ms) BEGIN
61
+ -------------------------------------------------
62
+ ActsAsNestedIntervalTest: test_create_first_child
63
+ -------------------------------------------------
64
+  (0.8ms) SAVEPOINT active_record_1
65
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
66
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 7]]
67
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 7]]
68
+ SQL (1.2ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 7], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
69
+  (0.6ms) RELEASE SAVEPOINT active_record_1
70
+  (0.6ms) ROLLBACK
71
+  (0.5ms) BEGIN
72
+ ------------------------------------------
73
+ ActsAsNestedIntervalTest: test_create_root
74
+ ------------------------------------------
75
+  (0.5ms) SAVEPOINT active_record_1
76
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
77
+  (0.6ms) RELEASE SAVEPOINT active_record_1
78
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" IS NULL
79
+  (0.6ms) ROLLBACK
80
+  (0.5ms) BEGIN
81
+ --------------------------------------------------
82
+ ActsAsNestedIntervalTest: test_create_second_child
83
+ --------------------------------------------------
84
+  (0.5ms) SAVEPOINT active_record_1
85
+ SQL (1.2ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
86
+  (0.6ms) RELEASE SAVEPOINT active_record_1
87
+  (0.5ms) SAVEPOINT active_record_1
88
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 10]]
89
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 10]]
90
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 10], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
91
+  (0.6ms) RELEASE SAVEPOINT active_record_1
92
+  (0.5ms) SAVEPOINT active_record_1
93
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]]
94
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 11]]
95
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 11], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
96
+  (0.6ms) RELEASE SAVEPOINT active_record_1
97
+  (0.5ms) SAVEPOINT active_record_1
98
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 11]]
99
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 11]]
100
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 11], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
101
+  (0.6ms) RELEASE SAVEPOINT active_record_1
102
+  (0.7ms) ROLLBACK
103
+  (0.5ms) BEGIN
104
+ -------------------------------------------------
105
+ ActsAsNestedIntervalTest: test_database_precision
106
+ -------------------------------------------------
107
+  (0.5ms) SAVEPOINT active_record_1
108
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "root"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
109
+  (0.6ms) RELEASE SAVEPOINT active_record_1
110
+  (0.5ms) SAVEPOINT active_record_1
111
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 14]]
112
+ Region Load (1.5ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 14]]
113
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "l1"], ["region_id", 14], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
114
+  (0.6ms) RELEASE SAVEPOINT active_record_1
115
+  (0.5ms) SAVEPOINT active_record_1
116
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 15]]
117
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 15]]
118
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "l2"], ["region_id", 15], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
119
+  (0.6ms) RELEASE SAVEPOINT active_record_1
120
+  (0.5ms) SAVEPOINT active_record_1
121
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 16]]
122
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 16]]
123
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.75"], ["lftp", 3], ["lftq", 4], ["name", "l3"], ["region_id", 16], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
124
+  (0.6ms) RELEASE SAVEPOINT active_record_1
125
+  (0.5ms) SAVEPOINT active_record_1
126
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 17]]
127
+ Region Load (0.7ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 17]]
128
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.8"], ["lftp", 4], ["lftq", 5], ["name", "l4"], ["region_id", 17], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
129
+  (0.7ms) RELEASE SAVEPOINT active_record_1
130
+  (0.5ms) SAVEPOINT active_record_1
131
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 17]]
132
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 15]]
133
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 15]]
134
+  (0.6ms) ROLLBACK TO SAVEPOINT active_record_1
135
+  (0.6ms) ROLLBACK
136
+  (0.5ms) BEGIN
137
+ ------------------------------------
138
+ ActsAsNestedIntervalTest: test_depth
139
+ ------------------------------------
140
+  (0.5ms) SAVEPOINT active_record_1
141
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
142
+  (0.6ms) RELEASE SAVEPOINT active_record_1
143
+  (0.6ms) SAVEPOINT active_record_1
144
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 19]]
145
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 19]]
146
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 19], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
147
+  (0.6ms) RELEASE SAVEPOINT active_record_1
148
+  (0.5ms) SAVEPOINT active_record_1
149
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 20]]
150
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 20]]
151
+ SQL (1.5ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 20], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
152
+  (0.6ms) RELEASE SAVEPOINT active_record_1
153
+  (0.5ms) SAVEPOINT active_record_1
154
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 20]]
155
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 20]]
156
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 20], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
157
+  (0.6ms) RELEASE SAVEPOINT active_record_1
158
+  (0.6ms) ROLLBACK
159
+  (0.5ms) BEGIN
160
+ ------------------------------------------
161
+ ActsAsNestedIntervalTest: test_descendants
162
+ ------------------------------------------
163
+  (0.5ms) SAVEPOINT active_record_1
164
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
165
+  (0.6ms) RELEASE SAVEPOINT active_record_1
166
+  (0.5ms) SAVEPOINT active_record_1
167
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 23]]
168
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 23]]
169
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 23], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
170
+  (2.2ms) RELEASE SAVEPOINT active_record_1
171
+  (0.5ms) SAVEPOINT active_record_1
172
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 24]]
173
+ Region Load (0.7ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 24]]
174
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 24], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
175
+  (0.6ms) RELEASE SAVEPOINT active_record_1
176
+  (1.0ms) SAVEPOINT active_record_1
177
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 24]]
178
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 24]]
179
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 24], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
180
+  (0.6ms) RELEASE SAVEPOINT active_record_1
181
+ Region Load (2.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (lft > 0.0 AND rgt <= 1.0)
182
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (lft > 0.5 AND rgt <= 1.0)
183
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (lft > 0.6666666666666666 AND rgt <= 1.0)
184
+  (1.2ms) ROLLBACK
185
+  (0.6ms) BEGIN
186
+ --------------------------------------
187
+ ActsAsNestedIntervalTest: test_destroy
188
+ --------------------------------------
189
+  (0.6ms) SAVEPOINT active_record_1
190
+ SQL (3.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
191
+  (3.0ms) RELEASE SAVEPOINT active_record_1
192
+  (0.6ms) SAVEPOINT active_record_1
193
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 27]]
194
+ Region Load (8.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 27]]
195
+ SQL (14.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 27], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
196
+  (0.7ms) RELEASE SAVEPOINT active_record_1
197
+  (9.5ms) SAVEPOINT active_record_1
198
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 28]]
199
+ Region Load (5.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 28]]
200
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 28], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
201
+  (2.7ms) RELEASE SAVEPOINT active_record_1
202
+  (3.2ms) SAVEPOINT active_record_1
203
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 28]]
204
+ Region Load (3.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 28]]
205
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 28], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
206
+  (0.8ms) RELEASE SAVEPOINT active_record_1
207
+  (0.5ms) SAVEPOINT active_record_1
208
+ Region Exists (1.0ms) SELECT 1 AS one FROM "regions" WHERE "regions"."region_id" = $1 LIMIT 1 [["region_id", 28]]
209
+  (0.6ms) ROLLBACK TO SAVEPOINT active_record_1
210
+  (0.7ms) ROLLBACK
211
+  (1.9ms) BEGIN
212
+ -------------------------------------
213
+ ActsAsNestedIntervalTest: test_limits
214
+ -------------------------------------
215
+  (0.6ms) SAVEPOINT active_record_1
216
+ SQL (5.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", ""], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
217
+  (2.3ms) RELEASE SAVEPOINT active_record_1
218
+  (0.6ms) SAVEPOINT active_record_1
219
+ Region Load (3.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 31]]
220
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 31]]
221
+ SQL (2.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", ""], ["region_id", 31], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
222
+  (1.3ms) RELEASE SAVEPOINT active_record_1
223
+  (0.5ms) SAVEPOINT active_record_1
224
+ Region Load (5.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 31]]
225
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 31]]
226
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", ""], ["region_id", 31], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
227
+  (2.0ms) RELEASE SAVEPOINT active_record_1
228
+  (0.7ms) SAVEPOINT active_record_1
229
+ Region Load (3.4ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 33]]
230
+ Region Load (2.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 33]]
231
+ SQL (1.6ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.4"], ["lftp", 2], ["lftq", 5], ["name", ""], ["region_id", 33], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
232
+  (0.6ms) RELEASE SAVEPOINT active_record_1
233
+  (0.5ms) SAVEPOINT active_record_1
234
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 33]]
235
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 33]]
236
+ SQL (1.2ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.375"], ["lftp", 3], ["lftq", 8], ["name", ""], ["region_id", 33], ["rgt", "0.4"], ["rgtp", 2], ["rgtq", 5]]
237
+  (0.6ms) RELEASE SAVEPOINT active_record_1
238
+  (0.5ms) SAVEPOINT active_record_1
239
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 35]]
240
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 35]]
241
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.384615384615385"], ["lftp", 5], ["lftq", 13], ["name", ""], ["region_id", 35], ["rgt", "0.4"], ["rgtp", 2], ["rgtq", 5]]
242
+  (0.6ms) RELEASE SAVEPOINT active_record_1
243
+  (0.5ms) SAVEPOINT active_record_1
244
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 35]]
245
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 35]]
246
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.380952380952381"], ["lftp", 8], ["lftq", 21], ["name", ""], ["region_id", 35], ["rgt", "0.384615384615385"], ["rgtp", 5], ["rgtq", 13]]
247
+  (0.6ms) RELEASE SAVEPOINT active_record_1
248
+  (0.6ms) SAVEPOINT active_record_1
249
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 37]]
250
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 37]]
251
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.382352941176471"], ["lftp", 13], ["lftq", 34], ["name", ""], ["region_id", 37], ["rgt", "0.384615384615385"], ["rgtp", 5], ["rgtq", 13]]
252
+  (0.6ms) RELEASE SAVEPOINT active_record_1
253
+  (0.5ms) SAVEPOINT active_record_1
254
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 37]]
255
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 37]]
256
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381818181818182"], ["lftp", 21], ["lftq", 55], ["name", ""], ["region_id", 37], ["rgt", "0.382352941176471"], ["rgtp", 13], ["rgtq", 34]]
257
+  (0.6ms) RELEASE SAVEPOINT active_record_1
258
+  (2.1ms) SAVEPOINT active_record_1
259
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 39]]
260
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 39]]
261
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.382022471910112"], ["lftp", 34], ["lftq", 89], ["name", ""], ["region_id", 39], ["rgt", "0.382352941176471"], ["rgtp", 13], ["rgtq", 34]]
262
+  (0.6ms) RELEASE SAVEPOINT active_record_1
263
+  (0.5ms) SAVEPOINT active_record_1
264
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 39]]
265
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 39]]
266
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381944444444444"], ["lftp", 55], ["lftq", 144], ["name", ""], ["region_id", 39], ["rgt", "0.382022471910112"], ["rgtp", 34], ["rgtq", 89]]
267
+  (0.7ms) RELEASE SAVEPOINT active_record_1
268
+  (7.1ms) SAVEPOINT active_record_1
269
+ Region Load (10.5ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 41]]
270
+ Region Load (5.5ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 41]]
271
+ SQL (6.3ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381974248927039"], ["lftp", 89], ["lftq", 233], ["name", ""], ["region_id", 41], ["rgt", "0.382022471910112"], ["rgtp", 34], ["rgtq", 89]]
272
+  (1.9ms) RELEASE SAVEPOINT active_record_1
273
+  (6.1ms) SAVEPOINT active_record_1
274
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 41]]
275
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 41]]
276
+ SQL (2.6ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381962864721485"], ["lftp", 144], ["lftq", 377], ["name", ""], ["region_id", 41], ["rgt", "0.381974248927039"], ["rgtp", 89], ["rgtq", 233]]
277
+  (0.6ms) RELEASE SAVEPOINT active_record_1
278
+  (0.5ms) SAVEPOINT active_record_1
279
+ Region Load (3.4ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 43]]
280
+ Region Load (1.4ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 43]]
281
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381967213114754"], ["lftp", 233], ["lftq", 610], ["name", ""], ["region_id", 43], ["rgt", "0.381974248927039"], ["rgtp", 89], ["rgtq", 233]]
282
+  (0.7ms) RELEASE SAVEPOINT active_record_1
283
+  (0.7ms) SAVEPOINT active_record_1
284
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 43]]
285
+ Region Load (1.6ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 43]]
286
+ SQL (1.2ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381965552178318"], ["lftp", 377], ["lftq", 987], ["name", ""], ["region_id", 43], ["rgt", "0.381967213114754"], ["rgtp", 233], ["rgtq", 610]]
287
+  (0.7ms) RELEASE SAVEPOINT active_record_1
288
+  (0.5ms) SAVEPOINT active_record_1
289
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 45]]
290
+ Region Load (9.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 45]]
291
+ SQL (2.6ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966186599875"], ["lftp", 610], ["lftq", 1597], ["name", ""], ["region_id", 45], ["rgt", "0.381967213114754"], ["rgtp", 233], ["rgtq", 610]]
292
+  (1.3ms) RELEASE SAVEPOINT active_record_1
293
+  (1.7ms) SAVEPOINT active_record_1
294
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 45]]
295
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 45]]
296
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381965944272446"], ["lftp", 987], ["lftq", 2584], ["name", ""], ["region_id", 45], ["rgt", "0.381966186599875"], ["rgtp", 610], ["rgtq", 1597]]
297
+  (0.6ms) RELEASE SAVEPOINT active_record_1
298
+  (0.6ms) SAVEPOINT active_record_1
299
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 47]]
300
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 47]]
301
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966036833293"], ["lftp", 1597], ["lftq", 4181], ["name", ""], ["region_id", 47], ["rgt", "0.381966186599875"], ["rgtp", 610], ["rgtq", 1597]]
302
+  (0.6ms) RELEASE SAVEPOINT active_record_1
303
+  (0.7ms) SAVEPOINT active_record_1
304
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 47]]
305
+ Region Load (2.6ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 47]]
306
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966001478197"], ["lftp", 2584], ["lftq", 6765], ["name", ""], ["region_id", 47], ["rgt", "0.381966036833293"], ["rgtp", 1597], ["rgtq", 4181]]
307
+  (0.7ms) RELEASE SAVEPOINT active_record_1
308
+  (0.7ms) SAVEPOINT active_record_1
309
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 49]]
310
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 49]]
311
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966014982642"], ["lftp", 4181], ["lftq", 10946], ["name", ""], ["region_id", 49], ["rgt", "0.381966036833293"], ["rgtp", 1597], ["rgtq", 4181]]
312
+  (0.6ms) RELEASE SAVEPOINT active_record_1
313
+  (3.2ms) SAVEPOINT active_record_1
314
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 49]]
315
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 49]]
316
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966009824403"], ["lftp", 6765], ["lftq", 17711], ["name", ""], ["region_id", 49], ["rgt", "0.381966014982642"], ["rgtp", 4181], ["rgtq", 10946]]
317
+  (4.3ms) RELEASE SAVEPOINT active_record_1
318
+  (0.5ms) SAVEPOINT active_record_1
319
+ Region Load (2.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 51]]
320
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 51]]
321
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011794675"], ["lftp", 10946], ["lftq", 28657], ["name", ""], ["region_id", 51], ["rgt", "0.381966014982642"], ["rgtp", 4181], ["rgtq", 10946]]
322
+  (0.7ms) RELEASE SAVEPOINT active_record_1
323
+  (4.1ms) SAVEPOINT active_record_1
324
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 51]]
325
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 51]]
326
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011042098"], ["lftp", 17711], ["lftq", 46368], ["name", ""], ["region_id", 51], ["rgt", "0.381966011794675"], ["rgtp", 10946], ["rgtq", 28657]]
327
+  (0.9ms) RELEASE SAVEPOINT active_record_1
328
+  (0.7ms) SAVEPOINT active_record_1
329
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 53]]
330
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 53]]
331
+ SQL (1.2ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011329557"], ["lftp", 28657], ["lftq", 75025], ["name", ""], ["region_id", 53], ["rgt", "0.381966011794675"], ["rgtp", 10946], ["rgtq", 28657]]
332
+  (1.0ms) RELEASE SAVEPOINT active_record_1
333
+  (0.6ms) SAVEPOINT active_record_1
334
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 53]]
335
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 53]]
336
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011219757"], ["lftp", 46368], ["lftq", 121393], ["name", ""], ["region_id", 53], ["rgt", "0.381966011329557"], ["rgtp", 28657], ["rgtq", 75025]]
337
+  (0.6ms) RELEASE SAVEPOINT active_record_1
338
+  (0.6ms) SAVEPOINT active_record_1
339
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 55]]
340
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 55]]
341
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011261697"], ["lftp", 75025], ["lftq", 196418], ["name", ""], ["region_id", 55], ["rgt", "0.381966011329557"], ["rgtp", 28657], ["rgtq", 75025]]
342
+  (0.7ms) RELEASE SAVEPOINT active_record_1
343
+  (0.5ms) SAVEPOINT active_record_1
344
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 55]]
345
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 55]]
346
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011245677"], ["lftp", 121393], ["lftq", 317811], ["name", ""], ["region_id", 55], ["rgt", "0.381966011261697"], ["rgtp", 75025], ["rgtq", 196418]]
347
+  (0.6ms) RELEASE SAVEPOINT active_record_1
348
+  (0.6ms) SAVEPOINT active_record_1
349
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 57]]
350
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 57]]
351
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011251796"], ["lftp", 196418], ["lftq", 514229], ["name", ""], ["region_id", 57], ["rgt", "0.381966011261697"], ["rgtp", 75025], ["rgtq", 196418]]
352
+  (0.6ms) RELEASE SAVEPOINT active_record_1
353
+  (0.6ms) SAVEPOINT active_record_1
354
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 57]]
355
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 57]]
356
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011249459"], ["lftp", 317811], ["lftq", 832040], ["name", ""], ["region_id", 57], ["rgt", "0.381966011251796"], ["rgtp", 196418], ["rgtq", 514229]]
357
+  (0.7ms) RELEASE SAVEPOINT active_record_1
358
+  (0.6ms) SAVEPOINT active_record_1
359
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 59]]
360
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 59]]
361
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250352"], ["lftp", 514229], ["lftq", 1346269], ["name", ""], ["region_id", 59], ["rgt", "0.381966011251796"], ["rgtp", 196418], ["rgtq", 514229]]
362
+  (0.6ms) RELEASE SAVEPOINT active_record_1
363
+  (0.5ms) SAVEPOINT active_record_1
364
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 59]]
365
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 59]]
366
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250011"], ["lftp", 832040], ["lftq", 2178309], ["name", ""], ["region_id", 59], ["rgt", "0.381966011250352"], ["rgtp", 514229], ["rgtq", 1346269]]
367
+  (0.6ms) RELEASE SAVEPOINT active_record_1
368
+  (0.6ms) SAVEPOINT active_record_1
369
+ Region Load (2.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 61]]
370
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 61]]
371
+ SQL (6.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250141"], ["lftp", 1346269], ["lftq", 3524578], ["name", ""], ["region_id", 61], ["rgt", "0.381966011250352"], ["rgtp", 514229], ["rgtq", 1346269]]
372
+  (17.4ms) RELEASE SAVEPOINT active_record_1
373
+  (0.6ms) SAVEPOINT active_record_1
374
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 61]]
375
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 61]]
376
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250091"], ["lftp", 2178309], ["lftq", 5702887], ["name", ""], ["region_id", 61], ["rgt", "0.381966011250141"], ["rgtp", 1346269], ["rgtq", 3524578]]
377
+  (2.2ms) RELEASE SAVEPOINT active_record_1
378
+  (1.9ms) SAVEPOINT active_record_1
379
+ Region Load (5.5ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 63]]
380
+ Region Load (8.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 63]]
381
+ SQL (5.4ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.38196601125011"], ["lftp", 3524578], ["lftq", 9227465], ["name", ""], ["region_id", 63], ["rgt", "0.381966011250141"], ["rgtp", 1346269], ["rgtq", 3524578]]
382
+  (0.6ms) RELEASE SAVEPOINT active_record_1
383
+  (0.6ms) SAVEPOINT active_record_1
384
+ Region Load (9.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 63]]
385
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 63]]
386
+ SQL (1.4ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250103"], ["lftp", 5702887], ["lftq", 14930352], ["name", ""], ["region_id", 63], ["rgt", "0.38196601125011"], ["rgtp", 3524578], ["rgtq", 9227465]]
387
+  (1.0ms) RELEASE SAVEPOINT active_record_1
388
+  (0.6ms) SAVEPOINT active_record_1
389
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 65]]
390
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 65]]
391
+ SQL (1.3ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250106"], ["lftp", 9227465], ["lftq", 24157817], ["name", ""], ["region_id", 65], ["rgt", "0.38196601125011"], ["rgtp", 3524578], ["rgtq", 9227465]]
392
+  (2.2ms) RELEASE SAVEPOINT active_record_1
393
+  (1.0ms) SAVEPOINT active_record_1
394
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 65]]
395
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 65]]
396
+ SQL (1.6ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 14930352], ["lftq", 39088169], ["name", ""], ["region_id", 65], ["rgt", "0.381966011250106"], ["rgtp", 9227465], ["rgtq", 24157817]]
397
+  (0.6ms) RELEASE SAVEPOINT active_record_1
398
+  (0.6ms) SAVEPOINT active_record_1
399
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 67]]
400
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 67]]
401
+ SQL (1.5ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 24157817], ["lftq", 63245986], ["name", ""], ["region_id", 67], ["rgt", "0.381966011250106"], ["rgtp", 9227465], ["rgtq", 24157817]]
402
+  (0.6ms) RELEASE SAVEPOINT active_record_1
403
+  (0.6ms) SAVEPOINT active_record_1
404
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 67]]
405
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 67]]
406
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 39088169], ["lftq", 102334155], ["name", ""], ["region_id", 67], ["rgt", "0.381966011250105"], ["rgtp", 24157817], ["rgtq", 63245986]]
407
+  (0.6ms) RELEASE SAVEPOINT active_record_1
408
+  (0.5ms) SAVEPOINT active_record_1
409
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 69]]
410
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 69]]
411
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 63245986], ["lftq", 165580141], ["name", ""], ["region_id", 69], ["rgt", "0.381966011250105"], ["rgtp", 24157817], ["rgtq", 63245986]]
412
+  (0.6ms) RELEASE SAVEPOINT active_record_1
413
+  (0.6ms) SAVEPOINT active_record_1
414
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 69]]
415
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 69]]
416
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 102334155], ["lftq", 267914296], ["name", ""], ["region_id", 69], ["rgt", "0.381966011250105"], ["rgtp", 63245986], ["rgtq", 165580141]]
417
+  (0.6ms) RELEASE SAVEPOINT active_record_1
418
+  (0.7ms) SAVEPOINT active_record_1
419
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 71]]
420
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 71]]
421
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 165580141], ["lftq", 433494437], ["name", ""], ["region_id", 71], ["rgt", "0.381966011250105"], ["rgtp", 63245986], ["rgtq", 165580141]]
422
+  (0.8ms) RELEASE SAVEPOINT active_record_1
423
+  (0.7ms) SAVEPOINT active_record_1
424
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 71]]
425
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 71]]
426
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 267914296], ["lftq", 701408733], ["name", ""], ["region_id", 71], ["rgt", "0.381966011250105"], ["rgtp", 165580141], ["rgtq", 433494437]]
427
+  (0.6ms) RELEASE SAVEPOINT active_record_1
428
+  (0.6ms) SAVEPOINT active_record_1
429
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 73]]
430
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 73]]
431
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 433494437], ["lftq", 1134903170], ["name", ""], ["region_id", 73], ["rgt", "0.381966011250105"], ["rgtp", 165580141], ["rgtq", 433494437]]
432
+  (0.6ms) RELEASE SAVEPOINT active_record_1
433
+  (0.5ms) SAVEPOINT active_record_1
434
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 73]]
435
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 73]]
436
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 701408733], ["lftq", 1836311903], ["name", ""], ["region_id", 73], ["rgt", "0.381966011250105"], ["rgtp", 433494437], ["rgtq", 1134903170]]
437
+  (0.6ms) RELEASE SAVEPOINT active_record_1
438
+  (0.7ms) ROLLBACK
439
+  (0.5ms) BEGIN
440
+ ----------------------------------------------
441
+ ActsAsNestedIntervalTest: test_modular_inverse
442
+ ----------------------------------------------
443
+  (0.6ms) ROLLBACK
444
+  (1.3ms) BEGIN
445
+ -----------------------------------
446
+ ActsAsNestedIntervalTest: test_move
447
+ -----------------------------------
448
+  (0.5ms) SAVEPOINT active_record_1
449
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
450
+  (0.6ms) RELEASE SAVEPOINT active_record_1
451
+  (0.6ms) SAVEPOINT active_record_1
452
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 76]]
453
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 76]]
454
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 76], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
455
+  (0.6ms) RELEASE SAVEPOINT active_record_1
456
+  (0.5ms) SAVEPOINT active_record_1
457
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 77]]
458
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 77]]
459
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 77], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
460
+  (0.6ms) RELEASE SAVEPOINT active_record_1
461
+  (0.5ms) SAVEPOINT active_record_1
462
+ Region Load (2.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 77]]
463
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 77]]
464
+ SQL (2.2ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 77], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
465
+  (0.7ms) RELEASE SAVEPOINT active_record_1
466
+  (0.6ms) SAVEPOINT active_record_1
467
+ Region Load (11.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 77]]
468
+ Region Load (5.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 77]]
469
+  (0.7ms) ROLLBACK TO SAVEPOINT active_record_1
470
+  (2.9ms) SAVEPOINT active_record_1
471
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 77]]
472
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 78]]
473
+  (2.5ms) ROLLBACK TO SAVEPOINT active_record_1
474
+  (0.7ms) SAVEPOINT active_record_1
475
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 76]]
476
+ Region Load (1.4ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 76]]
477
+ SQL (3.3ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "Pacific"], ["region_id", 76], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
478
+  (0.6ms) RELEASE SAVEPOINT active_record_1
479
+  (0.7ms) SAVEPOINT active_record_1
480
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 77]]
481
+ Region Load (3.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 80]]
482
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 80]]
483
+  (3.4ms) ROLLBACK TO SAVEPOINT active_record_1
484
+  (0.8ms) ROLLBACK
485
+  (0.7ms) BEGIN
486
+ ------------------------------------------------------
487
+ ActsAsNestedIntervalTest: test_move_from_left_to_right
488
+ ------------------------------------------------------
489
+  (0.6ms) SAVEPOINT active_record_1
490
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
491
+  (0.6ms) RELEASE SAVEPOINT active_record_1
492
+  (0.8ms) SAVEPOINT active_record_1
493
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 81]]
494
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 81]]
495
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "europe"], ["region_id", 81], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
496
+  (0.6ms) RELEASE SAVEPOINT active_record_1
497
+  (0.5ms) SAVEPOINT active_record_1
498
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 81]]
499
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 81]]
500
+ SQL (1.2ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "america"], ["region_id", 81], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
501
+  (0.6ms) RELEASE SAVEPOINT active_record_1
502
+  (0.6ms) SAVEPOINT active_record_1
503
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 83]]
504
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 83]]
505
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.4"], ["lftp", 2], ["lftq", 5], ["name", "usa"], ["region_id", 83], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
506
+  (0.6ms) RELEASE SAVEPOINT active_record_1
507
+  (0.6ms) SAVEPOINT active_record_1
508
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 84]]
509
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 84]]
510
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.428571428571429"], ["lftp", 3], ["lftq", 7], ["name", "texas"], ["region_id", 84], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
511
+  (0.8ms) RELEASE SAVEPOINT active_record_1
512
+  (0.8ms) SAVEPOINT active_record_1
513
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 85]]
514
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 85]]
515
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.444444444444444"], ["lftp", 4], ["lftq", 9], ["name", "houston"], ["region_id", 85], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
516
+  (0.9ms) RELEASE SAVEPOINT active_record_1
517
+  (0.8ms) SAVEPOINT active_record_1
518
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 85]]
519
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 82]]
520
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 82]]
521
+  (0.7ms) ROLLBACK TO SAVEPOINT active_record_1
522
+  (0.9ms) ROLLBACK
523
+  (0.6ms) BEGIN
524
+ ---------------------------------------------------------------
525
+ ActsAsNestedIntervalTest: test_move_to_root_recomputes_interval
526
+ ---------------------------------------------------------------
527
+  (0.5ms) SAVEPOINT active_record_1
528
+ Region Load (1.4ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
529
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Europe"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
530
+  (0.8ms) RELEASE SAVEPOINT active_record_1
531
+  (0.6ms) SAVEPOINT active_record_1
532
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 87]]
533
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 87]]
534
+ SQL (1.3ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Romania"], ["region_id", 87], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
535
+  (0.6ms) RELEASE SAVEPOINT active_record_1
536
+  (0.6ms) SAVEPOINT active_record_1
537
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
538
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "Asia"], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
539
+  (0.8ms) RELEASE SAVEPOINT active_record_1
540
+  (1.1ms) SAVEPOINT active_record_1
541
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
542
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["name", "America"], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
543
+  (0.7ms) RELEASE SAVEPOINT active_record_1
544
+  (0.7ms) SAVEPOINT active_record_1
545
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 88]]
546
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
547
+  (0.6ms) ROLLBACK TO SAVEPOINT active_record_1
548
+  (0.7ms) ROLLBACK
549
+  (0.7ms) BEGIN
550
+ ---------------------------------------
551
+ ActsAsNestedIntervalTest: test_preorder
552
+ ---------------------------------------
553
+  (0.7ms) SAVEPOINT active_record_1
554
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
555
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
556
+  (0.6ms) RELEASE SAVEPOINT active_record_1
557
+  (0.7ms) SAVEPOINT active_record_1
558
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 91]]
559
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 91]]
560
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Oceania"], ["region_id", 91], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
561
+  (0.6ms) RELEASE SAVEPOINT active_record_1
562
+  (0.6ms) SAVEPOINT active_record_1
563
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 91]]
564
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 91]]
565
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "Antarctica"], ["region_id", 91], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
566
+  (0.6ms) RELEASE SAVEPOINT active_record_1
567
+  (0.6ms) SAVEPOINT active_record_1
568
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 92]]
569
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 92]]
570
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.75"], ["lftp", 3], ["lftq", 4], ["name", "Australia"], ["region_id", 92], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
571
+  (0.6ms) RELEASE SAVEPOINT active_record_1
572
+  (0.8ms) SAVEPOINT active_record_1
573
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 92]]
574
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 92]]
575
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.714285714285714"], ["lftp", 5], ["lftq", 7], ["name", "New Zealand"], ["region_id", 92], ["rgt", "0.75"], ["rgtp", 3], ["rgtq", 4]]
576
+  (0.6ms) RELEASE SAVEPOINT active_record_1
577
+ Region Load (2.8ms) SELECT "regions".* FROM "regions" ORDER BY rgt DESC, lftp ASC
578
+  (0.7ms) ROLLBACK
579
+  (0.6ms) BEGIN
580
+ -----------------------------------------------------------
581
+ ActsAsNestedIntervalTest: test_rebuild_nested_interval_tree
582
+ -----------------------------------------------------------
583
+  (0.6ms) SAVEPOINT active_record_1
584
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
585
+ SQL (1.2ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Europe"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
586
+  (0.7ms) RELEASE SAVEPOINT active_record_1
587
+  (0.6ms) SAVEPOINT active_record_1
588
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 96]]
589
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 96]]
590
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Romania"], ["region_id", 96], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
591
+  (0.7ms) RELEASE SAVEPOINT active_record_1
592
+  (0.5ms) SAVEPOINT active_record_1
593
+ Region Load (1.5ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
594
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "Asia"], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
595
+  (0.6ms) RELEASE SAVEPOINT active_record_1
596
+  (0.5ms) SAVEPOINT active_record_1
597
+ Region Load (1.4ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
598
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["name", "America"], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
599
+  (0.7ms) RELEASE SAVEPOINT active_record_1
600
+  (0.6ms) ROLLBACK
601
+  (0.5ms) BEGIN
602
+ ---------------------------------------------------------
603
+ ActsAsNestedIntervalTest: test_root_update_keeps_interval
604
+ ---------------------------------------------------------
605
+  (0.5ms) SAVEPOINT active_record_1
606
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
607
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Europe"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
608
+  (0.6ms) RELEASE SAVEPOINT active_record_1
609
+  (0.5ms) SAVEPOINT active_record_1
610
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 100]]
611
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 100]]
612
+ SQL (1.7ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Romania"], ["region_id", 100], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
613
+  (0.6ms) RELEASE SAVEPOINT active_record_1
614
+  (0.5ms) SAVEPOINT active_record_1
615
+ Region Load (1.5ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
616
+ SQL (1.2ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "Asia"], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
617
+  (0.6ms) RELEASE SAVEPOINT active_record_1
618
+  (0.5ms) SAVEPOINT active_record_1
619
+ Region Load (1.4ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
620
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["name", "America"], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
621
+  (0.8ms) RELEASE SAVEPOINT active_record_1
622
+  (0.6ms) SAVEPOINT active_record_1
623
+ SQL (1.4ms) UPDATE "regions" SET "name" = $1 WHERE "regions"."id" = 103 [["name", "USA"]]
624
+  (0.6ms) RELEASE SAVEPOINT active_record_1
625
+  (0.6ms) ROLLBACK
626
+  (0.6ms) BEGIN
627
+ ------------------------------------
628
+ ActsAsNestedIntervalTest: test_scope
629
+ ------------------------------------
630
+  (0.6ms) SAVEPOINT active_record_1
631
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
632
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
633
+  (0.7ms) RELEASE SAVEPOINT active_record_1
634
+  (0.7ms) SAVEPOINT active_record_1
635
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 104]]
636
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 104]]
637
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Oceania"], ["region_id", 104], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
638
+  (0.7ms) RELEASE SAVEPOINT active_record_1
639
+  (0.7ms) SAVEPOINT active_record_1
640
+ Region Load (1.4ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 't' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
641
+ SQL (1.1ms) INSERT INTO "regions" ("fiction", "lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["fiction", "t"], ["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Krypton"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
642
+  (0.6ms) RELEASE SAVEPOINT active_record_1
643
+ Region Load (1.4ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (0 = 1 OR lftq = 2 AND lftp = 1 OR lftq = 1 AND lftp = 0)
644
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 't' AND (lft > 0.5 AND rgt <= 1.0)
645
+  (0.7ms) ROLLBACK
646
+  (0.6ms) BEGIN
647
+ ------------------------------------------------------
648
+ ActsAsNestedIntervalTest: test_virtual_root_allocation
649
+ ------------------------------------------------------
650
+  (0.6ms) SAVEPOINT active_record_1
651
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
652
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Europe"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
653
+  (0.8ms) RELEASE SAVEPOINT active_record_1
654
+  (0.6ms) SAVEPOINT active_record_1
655
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 107]]
656
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 107]]
657
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Romania"], ["region_id", 107], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
658
+  (0.6ms) RELEASE SAVEPOINT active_record_1
659
+  (0.5ms) SAVEPOINT active_record_1
660
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
661
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "Asia"], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
662
+  (0.6ms) RELEASE SAVEPOINT active_record_1
663
+  (0.6ms) SAVEPOINT active_record_1
664
+ Region Load (1.5ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
665
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["name", "America"], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
666
+  (0.6ms) RELEASE SAVEPOINT active_record_1
667
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" ORDER BY rgt DESC, lftp ASC
668
+  (0.7ms) ROLLBACK
669
+  (0.5ms) BEGIN
670
+ -------------------------------------------------
671
+ ActsAsNestedIntervalTest: test_virtual_root_order
672
+ -------------------------------------------------
673
+  (0.5ms) SAVEPOINT active_record_1
674
+ Region Load (3.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
675
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "1"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
676
+  (0.6ms) RELEASE SAVEPOINT active_record_1
677
+  (0.7ms) SAVEPOINT active_record_1
678
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
679
+ SQL (3.7ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "2"], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
680
+  (0.6ms) RELEASE SAVEPOINT active_record_1
681
+  (0.6ms) SAVEPOINT active_record_1
682
+ Region Load (1.5ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
683
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["name", "3"], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
684
+  (0.6ms) RELEASE SAVEPOINT active_record_1
685
+  (0.6ms) ROLLBACK
686
+ ActiveRecord::SchemaMigration Load (1.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
687
+  (0.7ms) BEGIN
688
+ ----------------------------------------
689
+ ActsAsNestedIntervalTest: test_ancestors
690
+ ----------------------------------------
691
+  (0.6ms) SAVEPOINT active_record_1
692
+ SQL (2.7ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
693
+  (0.7ms) RELEASE SAVEPOINT active_record_1
694
+  (0.7ms) SAVEPOINT active_record_1
695
+ Region Load (1.6ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 114]]
696
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 114]]
697
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 114], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
698
+  (0.6ms) RELEASE SAVEPOINT active_record_1
699
+  (0.6ms) SAVEPOINT active_record_1
700
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 115]]
701
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 115]]
702
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 115], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
703
+  (0.6ms) RELEASE SAVEPOINT active_record_1
704
+  (0.6ms) SAVEPOINT active_record_1
705
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 115]]
706
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 115]]
707
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 115], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
708
+  (0.6ms) RELEASE SAVEPOINT active_record_1
709
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (0 = 1)
710
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (0 = 1 OR lftq = 1 AND lftp = 0)
711
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (0 = 1 OR lftq = 2 AND lftp = 1 OR lftq = 1 AND lftp = 0)
712
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (0 = 1 OR lftq = 2 AND lftp = 1 OR lftq = 1 AND lftp = 0)
713
+  (0.7ms) ROLLBACK
714
+  (0.5ms) BEGIN
715
+ -------------------------------------------
716
+ ActsAsNestedIntervalTest: test_append_child
717
+ -------------------------------------------
718
+  (0.5ms) SAVEPOINT active_record_1
719
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
720
+  (0.6ms) RELEASE SAVEPOINT active_record_1
721
+  (1.9ms) SAVEPOINT active_record_1
722
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 118]]
723
+ Region Load (1.4ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 118]]
724
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 118]]
725
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 118], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
726
+  (0.6ms) RELEASE SAVEPOINT active_record_1
727
+  (0.9ms) ROLLBACK
728
+  (0.6ms) BEGIN
729
+ -------------------------------------------------
730
+ ActsAsNestedIntervalTest: test_create_first_child
731
+ -------------------------------------------------
732
+  (0.6ms) SAVEPOINT active_record_1
733
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
734
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 120]]
735
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 120]]
736
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 120], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
737
+  (0.7ms) RELEASE SAVEPOINT active_record_1
738
+  (0.7ms) ROLLBACK
739
+  (0.5ms) BEGIN
740
+ ------------------------------------------
741
+ ActsAsNestedIntervalTest: test_create_root
742
+ ------------------------------------------
743
+  (0.5ms) SAVEPOINT active_record_1
744
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
745
+  (0.7ms) RELEASE SAVEPOINT active_record_1
746
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" IS NULL
747
+  (1.2ms) ROLLBACK
748
+  (0.5ms) BEGIN
749
+ --------------------------------------------------
750
+ ActsAsNestedIntervalTest: test_create_second_child
751
+ --------------------------------------------------
752
+  (0.5ms) SAVEPOINT active_record_1
753
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
754
+  (0.6ms) RELEASE SAVEPOINT active_record_1
755
+  (0.5ms) SAVEPOINT active_record_1
756
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 123]]
757
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 123]]
758
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 123], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
759
+  (0.6ms) RELEASE SAVEPOINT active_record_1
760
+  (0.6ms) SAVEPOINT active_record_1
761
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 124]]
762
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 124]]
763
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 124], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
764
+  (0.6ms) RELEASE SAVEPOINT active_record_1
765
+  (0.5ms) SAVEPOINT active_record_1
766
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 124]]
767
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 124]]
768
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 124], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
769
+  (0.6ms) RELEASE SAVEPOINT active_record_1
770
+  (0.6ms) ROLLBACK
771
+  (0.5ms) BEGIN
772
+ -------------------------------------------------
773
+ ActsAsNestedIntervalTest: test_database_precision
774
+ -------------------------------------------------
775
+  (0.5ms) SAVEPOINT active_record_1
776
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "root"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
777
+  (0.6ms) RELEASE SAVEPOINT active_record_1
778
+  (0.9ms) SAVEPOINT active_record_1
779
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 127]]
780
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 127]]
781
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "l1"], ["region_id", 127], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
782
+  (0.6ms) RELEASE SAVEPOINT active_record_1
783
+  (0.5ms) SAVEPOINT active_record_1
784
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 128]]
785
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 128]]
786
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "l2"], ["region_id", 128], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
787
+  (0.6ms) RELEASE SAVEPOINT active_record_1
788
+  (0.5ms) SAVEPOINT active_record_1
789
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 129]]
790
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 129]]
791
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.75"], ["lftp", 3], ["lftq", 4], ["name", "l3"], ["region_id", 129], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
792
+  (0.6ms) RELEASE SAVEPOINT active_record_1
793
+  (0.5ms) SAVEPOINT active_record_1
794
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 130]]
795
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 130]]
796
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.8"], ["lftp", 4], ["lftq", 5], ["name", "l4"], ["region_id", 130], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
797
+  (0.6ms) RELEASE SAVEPOINT active_record_1
798
+  (0.5ms) SAVEPOINT active_record_1
799
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 130]]
800
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 128]]
801
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 128]]
802
+  (0.6ms) ROLLBACK TO SAVEPOINT active_record_1
803
+  (0.6ms) ROLLBACK
804
+  (0.6ms) BEGIN
805
+ ------------------------------------
806
+ ActsAsNestedIntervalTest: test_depth
807
+ ------------------------------------
808
+  (0.5ms) SAVEPOINT active_record_1
809
+ SQL (1.5ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
810
+  (0.6ms) RELEASE SAVEPOINT active_record_1
811
+  (0.5ms) SAVEPOINT active_record_1
812
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 132]]
813
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 132]]
814
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 132], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
815
+  (0.6ms) RELEASE SAVEPOINT active_record_1
816
+  (0.6ms) SAVEPOINT active_record_1
817
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 133]]
818
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 133]]
819
+ SQL (1.3ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 133], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
820
+  (0.6ms) RELEASE SAVEPOINT active_record_1
821
+  (0.5ms) SAVEPOINT active_record_1
822
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 133]]
823
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 133]]
824
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 133], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
825
+  (0.5ms) RELEASE SAVEPOINT active_record_1
826
+  (0.6ms) ROLLBACK
827
+  (0.5ms) BEGIN
828
+ ------------------------------------------
829
+ ActsAsNestedIntervalTest: test_descendants
830
+ ------------------------------------------
831
+  (0.6ms) SAVEPOINT active_record_1
832
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
833
+  (0.6ms) RELEASE SAVEPOINT active_record_1
834
+  (0.5ms) SAVEPOINT active_record_1
835
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 136]]
836
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 136]]
837
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 136], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
838
+  (0.6ms) RELEASE SAVEPOINT active_record_1
839
+  (0.6ms) SAVEPOINT active_record_1
840
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 137]]
841
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 137]]
842
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 137], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
843
+  (0.6ms) RELEASE SAVEPOINT active_record_1
844
+  (0.5ms) SAVEPOINT active_record_1
845
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 137]]
846
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 137]]
847
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 137], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
848
+  (0.7ms) RELEASE SAVEPOINT active_record_1
849
+ Region Load (1.6ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (lft > 0.0 AND rgt <= 1.0)
850
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (lft > 0.5 AND rgt <= 1.0)
851
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (lft > 0.6666666666666666 AND rgt <= 1.0)
852
+  (0.8ms) ROLLBACK
853
+  (0.5ms) BEGIN
854
+ --------------------------------------
855
+ ActsAsNestedIntervalTest: test_destroy
856
+ --------------------------------------
857
+  (0.5ms) SAVEPOINT active_record_1
858
+ SQL (1.3ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
859
+  (0.6ms) RELEASE SAVEPOINT active_record_1
860
+  (0.5ms) SAVEPOINT active_record_1
861
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 140]]
862
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 140]]
863
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 140], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
864
+  (0.6ms) RELEASE SAVEPOINT active_record_1
865
+  (0.5ms) SAVEPOINT active_record_1
866
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 141]]
867
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 141]]
868
+ SQL (1.5ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 141], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
869
+  (0.6ms) RELEASE SAVEPOINT active_record_1
870
+  (0.6ms) SAVEPOINT active_record_1
871
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 141]]
872
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 141]]
873
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 141], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
874
+  (0.6ms) RELEASE SAVEPOINT active_record_1
875
+  (0.5ms) SAVEPOINT active_record_1
876
+ Region Exists (1.0ms) SELECT 1 AS one FROM "regions" WHERE "regions"."region_id" = $1 LIMIT 1 [["region_id", 141]]
877
+  (0.7ms) ROLLBACK TO SAVEPOINT active_record_1
878
+  (0.9ms) ROLLBACK
879
+  (0.6ms) BEGIN
880
+ -------------------------------------
881
+ ActsAsNestedIntervalTest: test_limits
882
+ -------------------------------------
883
+  (0.6ms) SAVEPOINT active_record_1
884
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", ""], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
885
+  (0.7ms) RELEASE SAVEPOINT active_record_1
886
+  (0.5ms) SAVEPOINT active_record_1
887
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 144]]
888
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 144]]
889
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", ""], ["region_id", 144], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
890
+  (0.6ms) RELEASE SAVEPOINT active_record_1
891
+  (0.6ms) SAVEPOINT active_record_1
892
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 144]]
893
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 144]]
894
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", ""], ["region_id", 144], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
895
+  (0.6ms) RELEASE SAVEPOINT active_record_1
896
+  (0.5ms) SAVEPOINT active_record_1
897
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 146]]
898
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 146]]
899
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.4"], ["lftp", 2], ["lftq", 5], ["name", ""], ["region_id", 146], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
900
+  (0.6ms) RELEASE SAVEPOINT active_record_1
901
+  (0.5ms) SAVEPOINT active_record_1
902
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 146]]
903
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 146]]
904
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.375"], ["lftp", 3], ["lftq", 8], ["name", ""], ["region_id", 146], ["rgt", "0.4"], ["rgtp", 2], ["rgtq", 5]]
905
+  (0.6ms) RELEASE SAVEPOINT active_record_1
906
+  (0.6ms) SAVEPOINT active_record_1
907
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 148]]
908
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 148]]
909
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.384615384615385"], ["lftp", 5], ["lftq", 13], ["name", ""], ["region_id", 148], ["rgt", "0.4"], ["rgtp", 2], ["rgtq", 5]]
910
+  (0.6ms) RELEASE SAVEPOINT active_record_1
911
+  (0.5ms) SAVEPOINT active_record_1
912
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 148]]
913
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 148]]
914
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.380952380952381"], ["lftp", 8], ["lftq", 21], ["name", ""], ["region_id", 148], ["rgt", "0.384615384615385"], ["rgtp", 5], ["rgtq", 13]]
915
+  (0.6ms) RELEASE SAVEPOINT active_record_1
916
+  (0.5ms) SAVEPOINT active_record_1
917
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 150]]
918
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 150]]
919
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.382352941176471"], ["lftp", 13], ["lftq", 34], ["name", ""], ["region_id", 150], ["rgt", "0.384615384615385"], ["rgtp", 5], ["rgtq", 13]]
920
+  (0.6ms) RELEASE SAVEPOINT active_record_1
921
+  (0.5ms) SAVEPOINT active_record_1
922
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 150]]
923
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 150]]
924
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381818181818182"], ["lftp", 21], ["lftq", 55], ["name", ""], ["region_id", 150], ["rgt", "0.382352941176471"], ["rgtp", 13], ["rgtq", 34]]
925
+  (0.8ms) RELEASE SAVEPOINT active_record_1
926
+  (0.5ms) SAVEPOINT active_record_1
927
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 152]]
928
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 152]]
929
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.382022471910112"], ["lftp", 34], ["lftq", 89], ["name", ""], ["region_id", 152], ["rgt", "0.382352941176471"], ["rgtp", 13], ["rgtq", 34]]
930
+  (0.6ms) RELEASE SAVEPOINT active_record_1
931
+  (0.6ms) SAVEPOINT active_record_1
932
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 152]]
933
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 152]]
934
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381944444444444"], ["lftp", 55], ["lftq", 144], ["name", ""], ["region_id", 152], ["rgt", "0.382022471910112"], ["rgtp", 34], ["rgtq", 89]]
935
+  (0.6ms) RELEASE SAVEPOINT active_record_1
936
+  (1.4ms) SAVEPOINT active_record_1
937
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 154]]
938
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 154]]
939
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381974248927039"], ["lftp", 89], ["lftq", 233], ["name", ""], ["region_id", 154], ["rgt", "0.382022471910112"], ["rgtp", 34], ["rgtq", 89]]
940
+  (0.6ms) RELEASE SAVEPOINT active_record_1
941
+  (0.5ms) SAVEPOINT active_record_1
942
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 154]]
943
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 154]]
944
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381962864721485"], ["lftp", 144], ["lftq", 377], ["name", ""], ["region_id", 154], ["rgt", "0.381974248927039"], ["rgtp", 89], ["rgtq", 233]]
945
+  (0.6ms) RELEASE SAVEPOINT active_record_1
946
+  (0.5ms) SAVEPOINT active_record_1
947
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 156]]
948
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 156]]
949
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381967213114754"], ["lftp", 233], ["lftq", 610], ["name", ""], ["region_id", 156], ["rgt", "0.381974248927039"], ["rgtp", 89], ["rgtq", 233]]
950
+  (0.6ms) RELEASE SAVEPOINT active_record_1
951
+  (0.5ms) SAVEPOINT active_record_1
952
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 156]]
953
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 156]]
954
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381965552178318"], ["lftp", 377], ["lftq", 987], ["name", ""], ["region_id", 156], ["rgt", "0.381967213114754"], ["rgtp", 233], ["rgtq", 610]]
955
+  (0.6ms) RELEASE SAVEPOINT active_record_1
956
+  (0.6ms) SAVEPOINT active_record_1
957
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 158]]
958
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 158]]
959
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966186599875"], ["lftp", 610], ["lftq", 1597], ["name", ""], ["region_id", 158], ["rgt", "0.381967213114754"], ["rgtp", 233], ["rgtq", 610]]
960
+  (0.6ms) RELEASE SAVEPOINT active_record_1
961
+  (0.5ms) SAVEPOINT active_record_1
962
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 158]]
963
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 158]]
964
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381965944272446"], ["lftp", 987], ["lftq", 2584], ["name", ""], ["region_id", 158], ["rgt", "0.381966186599875"], ["rgtp", 610], ["rgtq", 1597]]
965
+  (0.6ms) RELEASE SAVEPOINT active_record_1
966
+  (0.5ms) SAVEPOINT active_record_1
967
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 160]]
968
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 160]]
969
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966036833293"], ["lftp", 1597], ["lftq", 4181], ["name", ""], ["region_id", 160], ["rgt", "0.381966186599875"], ["rgtp", 610], ["rgtq", 1597]]
970
+  (0.6ms) RELEASE SAVEPOINT active_record_1
971
+  (0.5ms) SAVEPOINT active_record_1
972
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 160]]
973
+ Region Load (5.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 160]]
974
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966001478197"], ["lftp", 2584], ["lftq", 6765], ["name", ""], ["region_id", 160], ["rgt", "0.381966036833293"], ["rgtp", 1597], ["rgtq", 4181]]
975
+  (0.6ms) RELEASE SAVEPOINT active_record_1
976
+  (0.5ms) SAVEPOINT active_record_1
977
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 162]]
978
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 162]]
979
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966014982642"], ["lftp", 4181], ["lftq", 10946], ["name", ""], ["region_id", 162], ["rgt", "0.381966036833293"], ["rgtp", 1597], ["rgtq", 4181]]
980
+  (0.6ms) RELEASE SAVEPOINT active_record_1
981
+  (0.5ms) SAVEPOINT active_record_1
982
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 162]]
983
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 162]]
984
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966009824403"], ["lftp", 6765], ["lftq", 17711], ["name", ""], ["region_id", 162], ["rgt", "0.381966014982642"], ["rgtp", 4181], ["rgtq", 10946]]
985
+  (0.6ms) RELEASE SAVEPOINT active_record_1
986
+  (0.5ms) SAVEPOINT active_record_1
987
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 164]]
988
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 164]]
989
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011794675"], ["lftp", 10946], ["lftq", 28657], ["name", ""], ["region_id", 164], ["rgt", "0.381966014982642"], ["rgtp", 4181], ["rgtq", 10946]]
990
+  (0.6ms) RELEASE SAVEPOINT active_record_1
991
+  (0.6ms) SAVEPOINT active_record_1
992
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 164]]
993
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 164]]
994
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011042098"], ["lftp", 17711], ["lftq", 46368], ["name", ""], ["region_id", 164], ["rgt", "0.381966011794675"], ["rgtp", 10946], ["rgtq", 28657]]
995
+  (0.7ms) RELEASE SAVEPOINT active_record_1
996
+  (0.5ms) SAVEPOINT active_record_1
997
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 166]]
998
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 166]]
999
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011329557"], ["lftp", 28657], ["lftq", 75025], ["name", ""], ["region_id", 166], ["rgt", "0.381966011794675"], ["rgtp", 10946], ["rgtq", 28657]]
1000
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1001
+  (0.5ms) SAVEPOINT active_record_1
1002
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 166]]
1003
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 166]]
1004
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011219757"], ["lftp", 46368], ["lftq", 121393], ["name", ""], ["region_id", 166], ["rgt", "0.381966011329557"], ["rgtp", 28657], ["rgtq", 75025]]
1005
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1006
+  (0.5ms) SAVEPOINT active_record_1
1007
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 168]]
1008
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 168]]
1009
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011261697"], ["lftp", 75025], ["lftq", 196418], ["name", ""], ["region_id", 168], ["rgt", "0.381966011329557"], ["rgtp", 28657], ["rgtq", 75025]]
1010
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1011
+  (0.5ms) SAVEPOINT active_record_1
1012
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 168]]
1013
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 168]]
1014
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011245677"], ["lftp", 121393], ["lftq", 317811], ["name", ""], ["region_id", 168], ["rgt", "0.381966011261697"], ["rgtp", 75025], ["rgtq", 196418]]
1015
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1016
+  (0.5ms) SAVEPOINT active_record_1
1017
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 170]]
1018
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 170]]
1019
+ SQL (1.2ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011251796"], ["lftp", 196418], ["lftq", 514229], ["name", ""], ["region_id", 170], ["rgt", "0.381966011261697"], ["rgtp", 75025], ["rgtq", 196418]]
1020
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1021
+  (0.5ms) SAVEPOINT active_record_1
1022
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 170]]
1023
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 170]]
1024
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011249459"], ["lftp", 317811], ["lftq", 832040], ["name", ""], ["region_id", 170], ["rgt", "0.381966011251796"], ["rgtp", 196418], ["rgtq", 514229]]
1025
+  (0.9ms) RELEASE SAVEPOINT active_record_1
1026
+  (0.5ms) SAVEPOINT active_record_1
1027
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 172]]
1028
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 172]]
1029
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250352"], ["lftp", 514229], ["lftq", 1346269], ["name", ""], ["region_id", 172], ["rgt", "0.381966011251796"], ["rgtp", 196418], ["rgtq", 514229]]
1030
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1031
+  (1.7ms) SAVEPOINT active_record_1
1032
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 172]]
1033
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 172]]
1034
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250011"], ["lftp", 832040], ["lftq", 2178309], ["name", ""], ["region_id", 172], ["rgt", "0.381966011250352"], ["rgtp", 514229], ["rgtq", 1346269]]
1035
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1036
+  (0.6ms) SAVEPOINT active_record_1
1037
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 174]]
1038
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 174]]
1039
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250141"], ["lftp", 1346269], ["lftq", 3524578], ["name", ""], ["region_id", 174], ["rgt", "0.381966011250352"], ["rgtp", 514229], ["rgtq", 1346269]]
1040
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1041
+  (0.5ms) SAVEPOINT active_record_1
1042
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 174]]
1043
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 174]]
1044
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250091"], ["lftp", 2178309], ["lftq", 5702887], ["name", ""], ["region_id", 174], ["rgt", "0.381966011250141"], ["rgtp", 1346269], ["rgtq", 3524578]]
1045
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1046
+  (0.5ms) SAVEPOINT active_record_1
1047
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 176]]
1048
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 176]]
1049
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.38196601125011"], ["lftp", 3524578], ["lftq", 9227465], ["name", ""], ["region_id", 176], ["rgt", "0.381966011250141"], ["rgtp", 1346269], ["rgtq", 3524578]]
1050
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1051
+  (0.6ms) SAVEPOINT active_record_1
1052
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 176]]
1053
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 176]]
1054
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250103"], ["lftp", 5702887], ["lftq", 14930352], ["name", ""], ["region_id", 176], ["rgt", "0.38196601125011"], ["rgtp", 3524578], ["rgtq", 9227465]]
1055
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1056
+  (0.6ms) SAVEPOINT active_record_1
1057
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 178]]
1058
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 178]]
1059
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250106"], ["lftp", 9227465], ["lftq", 24157817], ["name", ""], ["region_id", 178], ["rgt", "0.38196601125011"], ["rgtp", 3524578], ["rgtq", 9227465]]
1060
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1061
+  (0.5ms) SAVEPOINT active_record_1
1062
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 178]]
1063
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 178]]
1064
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 14930352], ["lftq", 39088169], ["name", ""], ["region_id", 178], ["rgt", "0.381966011250106"], ["rgtp", 9227465], ["rgtq", 24157817]]
1065
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1066
+  (0.6ms) SAVEPOINT active_record_1
1067
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 180]]
1068
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 180]]
1069
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 24157817], ["lftq", 63245986], ["name", ""], ["region_id", 180], ["rgt", "0.381966011250106"], ["rgtp", 9227465], ["rgtq", 24157817]]
1070
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1071
+  (0.5ms) SAVEPOINT active_record_1
1072
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 180]]
1073
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 180]]
1074
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 39088169], ["lftq", 102334155], ["name", ""], ["region_id", 180], ["rgt", "0.381966011250105"], ["rgtp", 24157817], ["rgtq", 63245986]]
1075
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1076
+  (0.5ms) SAVEPOINT active_record_1
1077
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 182]]
1078
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 182]]
1079
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 63245986], ["lftq", 165580141], ["name", ""], ["region_id", 182], ["rgt", "0.381966011250105"], ["rgtp", 24157817], ["rgtq", 63245986]]
1080
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1081
+  (0.6ms) SAVEPOINT active_record_1
1082
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 182]]
1083
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 182]]
1084
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 102334155], ["lftq", 267914296], ["name", ""], ["region_id", 182], ["rgt", "0.381966011250105"], ["rgtp", 63245986], ["rgtq", 165580141]]
1085
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1086
+  (0.5ms) SAVEPOINT active_record_1
1087
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 184]]
1088
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 184]]
1089
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 165580141], ["lftq", 433494437], ["name", ""], ["region_id", 184], ["rgt", "0.381966011250105"], ["rgtp", 63245986], ["rgtq", 165580141]]
1090
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1091
+  (0.5ms) SAVEPOINT active_record_1
1092
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 184]]
1093
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 184]]
1094
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 267914296], ["lftq", 701408733], ["name", ""], ["region_id", 184], ["rgt", "0.381966011250105"], ["rgtp", 165580141], ["rgtq", 433494437]]
1095
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1096
+  (0.5ms) SAVEPOINT active_record_1
1097
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 186]]
1098
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 186]]
1099
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 433494437], ["lftq", 1134903170], ["name", ""], ["region_id", 186], ["rgt", "0.381966011250105"], ["rgtp", 165580141], ["rgtq", 433494437]]
1100
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1101
+  (0.5ms) SAVEPOINT active_record_1
1102
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 186]]
1103
+ Region Load (1.7ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 186]]
1104
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 701408733], ["lftq", 1836311903], ["name", ""], ["region_id", 186], ["rgt", "0.381966011250105"], ["rgtp", 433494437], ["rgtq", 1134903170]]
1105
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1106
+  (0.7ms) ROLLBACK
1107
+  (0.6ms) BEGIN
1108
+ ----------------------------------------------
1109
+ ActsAsNestedIntervalTest: test_modular_inverse
1110
+ ----------------------------------------------
1111
+  (0.6ms) ROLLBACK
1112
+  (0.5ms) BEGIN
1113
+ -----------------------------------
1114
+ ActsAsNestedIntervalTest: test_move
1115
+ -----------------------------------
1116
+  (0.8ms) SAVEPOINT active_record_1
1117
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1118
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1119
+  (0.6ms) SAVEPOINT active_record_1
1120
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 189]]
1121
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 189]]
1122
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 189], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1123
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1124
+  (0.6ms) SAVEPOINT active_record_1
1125
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 190]]
1126
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 190]]
1127
+ SQL (1.2ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 190], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1128
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1129
+  (0.5ms) SAVEPOINT active_record_1
1130
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 190]]
1131
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 190]]
1132
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 190], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
1133
+  (0.7ms) RELEASE SAVEPOINT active_record_1
1134
+  (0.5ms) SAVEPOINT active_record_1
1135
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 190]]
1136
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 190]]
1137
+  (0.7ms) ROLLBACK TO SAVEPOINT active_record_1
1138
+  (0.5ms) SAVEPOINT active_record_1
1139
+ Region Load (1.4ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 190]]
1140
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 191]]
1141
+  (0.6ms) ROLLBACK TO SAVEPOINT active_record_1
1142
+  (0.6ms) SAVEPOINT active_record_1
1143
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 189]]
1144
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 189]]
1145
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "Pacific"], ["region_id", 189], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
1146
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1147
+  (0.6ms) SAVEPOINT active_record_1
1148
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 190]]
1149
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 193]]
1150
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 193]]
1151
+  (0.7ms) ROLLBACK TO SAVEPOINT active_record_1
1152
+  (0.6ms) ROLLBACK
1153
+  (0.5ms) BEGIN
1154
+ ------------------------------------------------------
1155
+ ActsAsNestedIntervalTest: test_move_from_left_to_right
1156
+ ------------------------------------------------------
1157
+  (0.6ms) SAVEPOINT active_record_1
1158
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1159
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1160
+  (0.5ms) SAVEPOINT active_record_1
1161
+ Region Load (1.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 194]]
1162
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 194]]
1163
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "europe"], ["region_id", 194], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1164
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1165
+  (0.5ms) SAVEPOINT active_record_1
1166
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 194]]
1167
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 194]]
1168
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "america"], ["region_id", 194], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
1169
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1170
+  (0.6ms) SAVEPOINT active_record_1
1171
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 196]]
1172
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 196]]
1173
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.4"], ["lftp", 2], ["lftq", 5], ["name", "usa"], ["region_id", 196], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
1174
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1175
+  (0.5ms) SAVEPOINT active_record_1
1176
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 197]]
1177
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 197]]
1178
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.428571428571429"], ["lftp", 3], ["lftq", 7], ["name", "texas"], ["region_id", 197], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
1179
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1180
+  (0.6ms) SAVEPOINT active_record_1
1181
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 198]]
1182
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 198]]
1183
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.444444444444444"], ["lftp", 4], ["lftq", 9], ["name", "houston"], ["region_id", 198], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
1184
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1185
+  (1.3ms) SAVEPOINT active_record_1
1186
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 198]]
1187
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 195]]
1188
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 195]]
1189
+  (0.8ms) ROLLBACK TO SAVEPOINT active_record_1
1190
+  (0.6ms) ROLLBACK
1191
+  (0.5ms) BEGIN
1192
+ ---------------------------------------------------------------
1193
+ ActsAsNestedIntervalTest: test_move_to_root_recomputes_interval
1194
+ ---------------------------------------------------------------
1195
+  (0.5ms) SAVEPOINT active_record_1
1196
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1197
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Europe"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1198
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1199
+  (0.9ms) SAVEPOINT active_record_1
1200
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 200]]
1201
+ Region Load (0.7ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 200]]
1202
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Romania"], ["region_id", 200], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1203
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1204
+  (0.5ms) SAVEPOINT active_record_1
1205
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1206
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "Asia"], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
1207
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1208
+  (0.6ms) SAVEPOINT active_record_1
1209
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1210
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["name", "America"], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
1211
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1212
+  (0.5ms) SAVEPOINT active_record_1
1213
+ Region Load (1.5ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 201]]
1214
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1215
+  (0.6ms) ROLLBACK TO SAVEPOINT active_record_1
1216
+  (0.6ms) ROLLBACK
1217
+  (0.5ms) BEGIN
1218
+ ---------------------------------------
1219
+ ActsAsNestedIntervalTest: test_preorder
1220
+ ---------------------------------------
1221
+  (0.6ms) SAVEPOINT active_record_1
1222
+ Region Load (1.4ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1223
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1224
+  (1.1ms) RELEASE SAVEPOINT active_record_1
1225
+  (0.6ms) SAVEPOINT active_record_1
1226
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 204]]
1227
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 204]]
1228
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Oceania"], ["region_id", 204], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1229
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1230
+  (0.5ms) SAVEPOINT active_record_1
1231
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 204]]
1232
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 204]]
1233
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "Antarctica"], ["region_id", 204], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
1234
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1235
+  (0.5ms) SAVEPOINT active_record_1
1236
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 205]]
1237
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 205]]
1238
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.75"], ["lftp", 3], ["lftq", 4], ["name", "Australia"], ["region_id", 205], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1239
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1240
+  (0.5ms) SAVEPOINT active_record_1
1241
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 205]]
1242
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 205]]
1243
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.714285714285714"], ["lftp", 5], ["lftq", 7], ["name", "New Zealand"], ["region_id", 205], ["rgt", "0.75"], ["rgtp", 3], ["rgtq", 4]]
1244
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1245
+ Region Load (2.0ms) SELECT "regions".* FROM "regions" ORDER BY rgt DESC, lftp ASC
1246
+  (0.7ms) ROLLBACK
1247
+  (0.6ms) BEGIN
1248
+ -----------------------------------------------------------
1249
+ ActsAsNestedIntervalTest: test_rebuild_nested_interval_tree
1250
+ -----------------------------------------------------------
1251
+  (0.6ms) SAVEPOINT active_record_1
1252
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1253
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Europe"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1254
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1255
+  (0.6ms) SAVEPOINT active_record_1
1256
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 209]]
1257
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 209]]
1258
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Romania"], ["region_id", 209], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1259
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1260
+  (0.5ms) SAVEPOINT active_record_1
1261
+ Region Load (1.4ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1262
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "Asia"], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
1263
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1264
+  (0.5ms) SAVEPOINT active_record_1
1265
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1266
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["name", "America"], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
1267
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1268
+ SQL (2.1ms) UPDATE "regions" SET "lftp" = 0, "lftq" = 0, "rgtp" = 0, "rgtq" = 0, "lft" = 0, "rgt" = 0 WHERE ("regions".lftq > 0)
1269
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" IS NULL ORDER BY "regions"."id" ASC LIMIT 1000
1270
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE ("regions".lftq > 0) AND "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1271
+  (0.6ms) SAVEPOINT active_record_1
1272
+ SQL (1.1ms) UPDATE "regions" SET "lft" = $1, "lftp" = $2, "lftq" = $3, "rgt" = $4, "rgtp" = $5, "rgtq" = $6 WHERE "regions"."id" = 209 [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1273
+  (0.7ms) RELEASE SAVEPOINT active_record_1
1274
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = 209 ORDER BY "regions"."id" ASC LIMIT 1000
1275
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE ("regions".lftq > 0) AND "regions"."id" = $1 LIMIT 1 [["id", 209]]
1276
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 209]]
1277
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE ("regions".lftq > 0) AND "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 209]]
1278
+  (0.7ms) SAVEPOINT active_record_1
1279
+ SQL (1.0ms) UPDATE "regions" SET "lft" = $1, "lftp" = $2, "lftq" = $3, "rgt" = $4, "rgtp" = $5, "rgtq" = $6 WHERE "regions"."id" = 210 [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1280
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1281
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = 210 ORDER BY "regions"."id" ASC LIMIT 1000
1282
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE ("regions".lftq > 0) AND "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1283
+  (0.6ms) SAVEPOINT active_record_1
1284
+ SQL (1.2ms) UPDATE "regions" SET "lft" = $1, "lftp" = $2, "lftq" = $3, "rgt" = $4, "rgtp" = $5, "rgtq" = $6 WHERE "regions"."id" = 211 [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
1285
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1286
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = 211 ORDER BY "regions"."id" ASC LIMIT 1000
1287
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE ("regions".lftq > 0) AND "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1288
+  (0.6ms) SAVEPOINT active_record_1
1289
+ SQL (1.1ms) UPDATE "regions" SET "lft" = $1, "lftp" = $2, "lftq" = $3, "rgt" = $4, "rgtp" = $5, "rgtq" = $6 WHERE "regions"."id" = 212 [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
1290
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1291
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = 212 ORDER BY "regions"."id" ASC LIMIT 1000
1292
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" ORDER BY rgt DESC, lftp ASC
1293
+  (0.7ms) ROLLBACK
1294
+  (0.5ms) BEGIN
1295
+ ---------------------------------------------------------
1296
+ ActsAsNestedIntervalTest: test_root_update_keeps_interval
1297
+ ---------------------------------------------------------
1298
+  (1.0ms) SAVEPOINT active_record_1
1299
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1300
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Europe"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1301
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1302
+  (0.5ms) SAVEPOINT active_record_1
1303
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 213]]
1304
+ Region Load (2.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 213]]
1305
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Romania"], ["region_id", 213], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1306
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1307
+  (0.6ms) SAVEPOINT active_record_1
1308
+ Region Load (1.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1309
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "Asia"], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
1310
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1311
+  (0.5ms) SAVEPOINT active_record_1
1312
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1313
+ SQL (1.3ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["name", "America"], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
1314
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1315
+  (0.5ms) SAVEPOINT active_record_1
1316
+ Region Load (2.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" IN (216, '---
1317
+ :lock: true
1318
+ ')
1319
+ PG::InvalidTextRepresentation: BŁĄD: nieprawidłowa składnia wejścia dla integer: "---
1320
+ :lock: true
1321
+ "
1322
+ LINE 1: ...egions".* FROM "regions" WHERE "regions"."id" IN (216, '---
1323
+ ^
1324
+ : SELECT "regions".* FROM "regions" WHERE "regions"."id" IN (216, '---
1325
+ :lock: true
1326
+ ')
1327
+  (0.6ms) ROLLBACK TO SAVEPOINT active_record_1
1328
+  (0.6ms) ROLLBACK
1329
+  (0.5ms) BEGIN
1330
+ ------------------------------------
1331
+ ActsAsNestedIntervalTest: test_scope
1332
+ ------------------------------------
1333
+  (0.5ms) SAVEPOINT active_record_1
1334
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1335
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1336
+  (0.7ms) RELEASE SAVEPOINT active_record_1
1337
+  (0.6ms) SAVEPOINT active_record_1
1338
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 217]]
1339
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 217]]
1340
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Oceania"], ["region_id", 217], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1341
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1342
+  (0.5ms) SAVEPOINT active_record_1
1343
+ Region Load (1.4ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 't' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1344
+ SQL (1.1ms) INSERT INTO "regions" ("fiction", "lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["fiction", "t"], ["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Krypton"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1345
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1346
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (0 = 1 OR lftq = 2 AND lftp = 1 OR lftq = 1 AND lftp = 0)
1347
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 't' AND (lft > 0.5 AND rgt <= 1.0)
1348
+  (0.6ms) ROLLBACK
1349
+  (0.5ms) BEGIN
1350
+ ------------------------------------------------------
1351
+ ActsAsNestedIntervalTest: test_virtual_root_allocation
1352
+ ------------------------------------------------------
1353
+  (0.5ms) SAVEPOINT active_record_1
1354
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1355
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Europe"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1356
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1357
+  (0.5ms) SAVEPOINT active_record_1
1358
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 220]]
1359
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 220]]
1360
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Romania"], ["region_id", 220], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1361
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1362
+  (0.5ms) SAVEPOINT active_record_1
1363
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1364
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "Asia"], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
1365
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1366
+  (0.5ms) SAVEPOINT active_record_1
1367
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1368
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["name", "America"], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
1369
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1370
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" ORDER BY rgt DESC, lftp ASC
1371
+  (0.6ms) ROLLBACK
1372
+  (0.6ms) BEGIN
1373
+ -------------------------------------------------
1374
+ ActsAsNestedIntervalTest: test_virtual_root_order
1375
+ -------------------------------------------------
1376
+  (0.6ms) SAVEPOINT active_record_1
1377
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1378
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "1"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1379
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1380
+  (0.6ms) SAVEPOINT active_record_1
1381
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1382
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "2"], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
1383
+  (0.7ms) RELEASE SAVEPOINT active_record_1
1384
+  (0.6ms) SAVEPOINT active_record_1
1385
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1386
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["name", "3"], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
1387
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1388
+  (0.6ms) ROLLBACK
1389
+ ActiveRecord::SchemaMigration Load (1.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
1390
+  (0.6ms) BEGIN
1391
+ ----------------------------------------
1392
+ ActsAsNestedIntervalTest: test_ancestors
1393
+ ----------------------------------------
1394
+  (0.6ms) SAVEPOINT active_record_1
1395
+ SQL (1.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1396
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1397
+  (0.7ms) SAVEPOINT active_record_1
1398
+ Region Load (1.6ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 227]]
1399
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 227]]
1400
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 227], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1401
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1402
+  (0.6ms) SAVEPOINT active_record_1
1403
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 228]]
1404
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 228]]
1405
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 228], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1406
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1407
+  (0.5ms) SAVEPOINT active_record_1
1408
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 228]]
1409
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 228]]
1410
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 228], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
1411
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1412
+ Region Load (1.7ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (0 = 1)
1413
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (0 = 1 OR lftq = 1 AND lftp = 0)
1414
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (0 = 1 OR lftq = 2 AND lftp = 1 OR lftq = 1 AND lftp = 0)
1415
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (0 = 1 OR lftq = 2 AND lftp = 1 OR lftq = 1 AND lftp = 0)
1416
+  (0.8ms) ROLLBACK
1417
+  (0.5ms) BEGIN
1418
+ -------------------------------------------
1419
+ ActsAsNestedIntervalTest: test_append_child
1420
+ -------------------------------------------
1421
+  (0.7ms) SAVEPOINT active_record_1
1422
+ SQL (1.3ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1423
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1424
+  (0.5ms) SAVEPOINT active_record_1
1425
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 231]]
1426
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 231]]
1427
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 231]]
1428
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 231], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1429
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1430
+  (1.0ms) ROLLBACK
1431
+  (0.7ms) BEGIN
1432
+ -------------------------------------------------
1433
+ ActsAsNestedIntervalTest: test_create_first_child
1434
+ -------------------------------------------------
1435
+  (0.6ms) SAVEPOINT active_record_1
1436
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1437
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 233]]
1438
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 233]]
1439
+ SQL (1.3ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 233], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1440
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1441
+  (0.6ms) ROLLBACK
1442
+  (0.6ms) BEGIN
1443
+ ------------------------------------------
1444
+ ActsAsNestedIntervalTest: test_create_root
1445
+ ------------------------------------------
1446
+  (0.6ms) SAVEPOINT active_record_1
1447
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1448
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1449
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" IS NULL
1450
+  (0.6ms) ROLLBACK
1451
+  (0.5ms) BEGIN
1452
+ --------------------------------------------------
1453
+ ActsAsNestedIntervalTest: test_create_second_child
1454
+ --------------------------------------------------
1455
+  (0.6ms) SAVEPOINT active_record_1
1456
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1457
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1458
+  (0.5ms) SAVEPOINT active_record_1
1459
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 236]]
1460
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 236]]
1461
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 236], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1462
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1463
+  (0.5ms) SAVEPOINT active_record_1
1464
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 237]]
1465
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 237]]
1466
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 237], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1467
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1468
+  (0.6ms) SAVEPOINT active_record_1
1469
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 237]]
1470
+ Region Load (3.7ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 237]]
1471
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 237], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
1472
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1473
+  (0.8ms) ROLLBACK
1474
+  (0.6ms) BEGIN
1475
+ -------------------------------------------------
1476
+ ActsAsNestedIntervalTest: test_database_precision
1477
+ -------------------------------------------------
1478
+  (0.5ms) SAVEPOINT active_record_1
1479
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "root"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1480
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1481
+  (0.5ms) SAVEPOINT active_record_1
1482
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 240]]
1483
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 240]]
1484
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "l1"], ["region_id", 240], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1485
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1486
+  (0.5ms) SAVEPOINT active_record_1
1487
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 241]]
1488
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 241]]
1489
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "l2"], ["region_id", 241], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1490
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1491
+  (0.7ms) SAVEPOINT active_record_1
1492
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 242]]
1493
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 242]]
1494
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.75"], ["lftp", 3], ["lftq", 4], ["name", "l3"], ["region_id", 242], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1495
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1496
+  (0.6ms) SAVEPOINT active_record_1
1497
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 243]]
1498
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 243]]
1499
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.8"], ["lftp", 4], ["lftq", 5], ["name", "l4"], ["region_id", 243], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1500
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1501
+  (0.5ms) SAVEPOINT active_record_1
1502
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 243]]
1503
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 241]]
1504
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 241]]
1505
+ SQL (4.3ms) UPDATE "regions" SET rgtp = 5 * rgtp + -3 * rgtq, rgtq = 7 * rgtp + -4 * rgtq, rgt = 1.000000000000000000000000000000 * (5 * rgtp + -3 * rgtq) / (7 * rgtp + -4 * rgtq), lftp = 5 * lftp + -3 * lftq, lftq = 7 * lftp + -4 * lftq, lft = 1.000000000000000000000000000000 * (5 * lftp + -3 * lftq) / (7 * lftp + -4 * lftq) WHERE "regions"."fiction" = 'f' AND (lft > 0.75 AND rgt <= 1.0)
1506
+ SQL (1.0ms) UPDATE "regions" SET "lft" = $1, "lftq" = $2, "region_id" = $3, "rgt" = $4, "rgtp" = $5, "rgtq" = $6 WHERE "regions"."id" = 243 [["lft", "0.6"], ["lftq", 5], ["region_id", 241], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
1507
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1508
+  (2.1ms) SELECT COUNT(*) FROM "regions" WHERE (abs(rgt - (select rgt from regions where id =243)) < 1e-16)
1509
+  (0.8ms) ROLLBACK
1510
+  (0.6ms) BEGIN
1511
+ ------------------------------------
1512
+ ActsAsNestedIntervalTest: test_depth
1513
+ ------------------------------------
1514
+  (0.7ms) SAVEPOINT active_record_1
1515
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1516
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1517
+  (0.5ms) SAVEPOINT active_record_1
1518
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 245]]
1519
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 245]]
1520
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 245], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1521
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1522
+  (0.5ms) SAVEPOINT active_record_1
1523
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 246]]
1524
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 246]]
1525
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 246], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1526
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1527
+  (0.8ms) SAVEPOINT active_record_1
1528
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 246]]
1529
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 246]]
1530
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 246], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
1531
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1532
+  (0.6ms) ROLLBACK
1533
+  (0.5ms) BEGIN
1534
+ ------------------------------------------
1535
+ ActsAsNestedIntervalTest: test_descendants
1536
+ ------------------------------------------
1537
+  (0.6ms) SAVEPOINT active_record_1
1538
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1539
+  (0.7ms) RELEASE SAVEPOINT active_record_1
1540
+  (0.6ms) SAVEPOINT active_record_1
1541
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 249]]
1542
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 249]]
1543
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 249], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1544
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1545
+  (0.6ms) SAVEPOINT active_record_1
1546
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 250]]
1547
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 250]]
1548
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 250], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1549
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1550
+  (0.5ms) SAVEPOINT active_record_1
1551
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 250]]
1552
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 250]]
1553
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 250], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
1554
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1555
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (lft > 0.0 AND rgt <= 1.0)
1556
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (lft > 0.5 AND rgt <= 1.0)
1557
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (lft > 0.6666666666666666 AND rgt <= 1.0)
1558
+  (0.7ms) ROLLBACK
1559
+  (0.6ms) BEGIN
1560
+ --------------------------------------
1561
+ ActsAsNestedIntervalTest: test_destroy
1562
+ --------------------------------------
1563
+  (0.6ms) SAVEPOINT active_record_1
1564
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1565
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1566
+  (0.5ms) SAVEPOINT active_record_1
1567
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 253]]
1568
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 253]]
1569
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 253], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1570
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1571
+  (0.5ms) SAVEPOINT active_record_1
1572
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 254]]
1573
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 254]]
1574
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 254], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1575
+  (0.7ms) RELEASE SAVEPOINT active_record_1
1576
+  (0.5ms) SAVEPOINT active_record_1
1577
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 254]]
1578
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 254]]
1579
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 254], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
1580
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1581
+  (0.6ms) SAVEPOINT active_record_1
1582
+ Region Exists (1.0ms) SELECT 1 AS one FROM "regions" WHERE "regions"."region_id" = $1 LIMIT 1 [["region_id", 254]]
1583
+  (0.6ms) ROLLBACK TO SAVEPOINT active_record_1
1584
+  (0.7ms) ROLLBACK
1585
+  (0.5ms) BEGIN
1586
+ -------------------------------------
1587
+ ActsAsNestedIntervalTest: test_limits
1588
+ -------------------------------------
1589
+  (0.6ms) SAVEPOINT active_record_1
1590
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", ""], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1591
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1592
+  (0.6ms) SAVEPOINT active_record_1
1593
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 257]]
1594
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 257]]
1595
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", ""], ["region_id", 257], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1596
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1597
+  (0.6ms) SAVEPOINT active_record_1
1598
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 257]]
1599
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 257]]
1600
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", ""], ["region_id", 257], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
1601
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1602
+  (0.6ms) SAVEPOINT active_record_1
1603
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 259]]
1604
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 259]]
1605
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.4"], ["lftp", 2], ["lftq", 5], ["name", ""], ["region_id", 259], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
1606
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1607
+  (0.5ms) SAVEPOINT active_record_1
1608
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 259]]
1609
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 259]]
1610
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.375"], ["lftp", 3], ["lftq", 8], ["name", ""], ["region_id", 259], ["rgt", "0.4"], ["rgtp", 2], ["rgtq", 5]]
1611
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1612
+  (0.6ms) SAVEPOINT active_record_1
1613
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 261]]
1614
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 261]]
1615
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.384615384615385"], ["lftp", 5], ["lftq", 13], ["name", ""], ["region_id", 261], ["rgt", "0.4"], ["rgtp", 2], ["rgtq", 5]]
1616
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1617
+  (0.5ms) SAVEPOINT active_record_1
1618
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 261]]
1619
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 261]]
1620
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.380952380952381"], ["lftp", 8], ["lftq", 21], ["name", ""], ["region_id", 261], ["rgt", "0.384615384615385"], ["rgtp", 5], ["rgtq", 13]]
1621
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1622
+  (0.5ms) SAVEPOINT active_record_1
1623
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 263]]
1624
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 263]]
1625
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.382352941176471"], ["lftp", 13], ["lftq", 34], ["name", ""], ["region_id", 263], ["rgt", "0.384615384615385"], ["rgtp", 5], ["rgtq", 13]]
1626
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1627
+  (0.6ms) SAVEPOINT active_record_1
1628
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 263]]
1629
+ Region Load (1.5ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 263]]
1630
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381818181818182"], ["lftp", 21], ["lftq", 55], ["name", ""], ["region_id", 263], ["rgt", "0.382352941176471"], ["rgtp", 13], ["rgtq", 34]]
1631
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1632
+  (0.5ms) SAVEPOINT active_record_1
1633
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 265]]
1634
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 265]]
1635
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.382022471910112"], ["lftp", 34], ["lftq", 89], ["name", ""], ["region_id", 265], ["rgt", "0.382352941176471"], ["rgtp", 13], ["rgtq", 34]]
1636
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1637
+  (0.6ms) SAVEPOINT active_record_1
1638
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 265]]
1639
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 265]]
1640
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381944444444444"], ["lftp", 55], ["lftq", 144], ["name", ""], ["region_id", 265], ["rgt", "0.382022471910112"], ["rgtp", 34], ["rgtq", 89]]
1641
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1642
+  (0.5ms) SAVEPOINT active_record_1
1643
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 267]]
1644
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 267]]
1645
+ SQL (1.5ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381974248927039"], ["lftp", 89], ["lftq", 233], ["name", ""], ["region_id", 267], ["rgt", "0.382022471910112"], ["rgtp", 34], ["rgtq", 89]]
1646
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1647
+  (0.6ms) SAVEPOINT active_record_1
1648
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 267]]
1649
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 267]]
1650
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381962864721485"], ["lftp", 144], ["lftq", 377], ["name", ""], ["region_id", 267], ["rgt", "0.381974248927039"], ["rgtp", 89], ["rgtq", 233]]
1651
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1652
+  (0.5ms) SAVEPOINT active_record_1
1653
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 269]]
1654
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 269]]
1655
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381967213114754"], ["lftp", 233], ["lftq", 610], ["name", ""], ["region_id", 269], ["rgt", "0.381974248927039"], ["rgtp", 89], ["rgtq", 233]]
1656
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1657
+  (0.5ms) SAVEPOINT active_record_1
1658
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 269]]
1659
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 269]]
1660
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381965552178318"], ["lftp", 377], ["lftq", 987], ["name", ""], ["region_id", 269], ["rgt", "0.381967213114754"], ["rgtp", 233], ["rgtq", 610]]
1661
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1662
+  (0.5ms) SAVEPOINT active_record_1
1663
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 271]]
1664
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 271]]
1665
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966186599875"], ["lftp", 610], ["lftq", 1597], ["name", ""], ["region_id", 271], ["rgt", "0.381967213114754"], ["rgtp", 233], ["rgtq", 610]]
1666
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1667
+  (0.6ms) SAVEPOINT active_record_1
1668
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 271]]
1669
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 271]]
1670
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381965944272446"], ["lftp", 987], ["lftq", 2584], ["name", ""], ["region_id", 271], ["rgt", "0.381966186599875"], ["rgtp", 610], ["rgtq", 1597]]
1671
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1672
+  (0.5ms) SAVEPOINT active_record_1
1673
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 273]]
1674
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 273]]
1675
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966036833293"], ["lftp", 1597], ["lftq", 4181], ["name", ""], ["region_id", 273], ["rgt", "0.381966186599875"], ["rgtp", 610], ["rgtq", 1597]]
1676
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1677
+  (0.5ms) SAVEPOINT active_record_1
1678
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 273]]
1679
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 273]]
1680
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966001478197"], ["lftp", 2584], ["lftq", 6765], ["name", ""], ["region_id", 273], ["rgt", "0.381966036833293"], ["rgtp", 1597], ["rgtq", 4181]]
1681
+  (0.7ms) RELEASE SAVEPOINT active_record_1
1682
+  (0.7ms) SAVEPOINT active_record_1
1683
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 275]]
1684
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 275]]
1685
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966014982642"], ["lftp", 4181], ["lftq", 10946], ["name", ""], ["region_id", 275], ["rgt", "0.381966036833293"], ["rgtp", 1597], ["rgtq", 4181]]
1686
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1687
+  (0.6ms) SAVEPOINT active_record_1
1688
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 275]]
1689
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 275]]
1690
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966009824403"], ["lftp", 6765], ["lftq", 17711], ["name", ""], ["region_id", 275], ["rgt", "0.381966014982642"], ["rgtp", 4181], ["rgtq", 10946]]
1691
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1692
+  (0.7ms) SAVEPOINT active_record_1
1693
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 277]]
1694
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 277]]
1695
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011794675"], ["lftp", 10946], ["lftq", 28657], ["name", ""], ["region_id", 277], ["rgt", "0.381966014982642"], ["rgtp", 4181], ["rgtq", 10946]]
1696
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1697
+  (0.6ms) SAVEPOINT active_record_1
1698
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 277]]
1699
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 277]]
1700
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011042098"], ["lftp", 17711], ["lftq", 46368], ["name", ""], ["region_id", 277], ["rgt", "0.381966011794675"], ["rgtp", 10946], ["rgtq", 28657]]
1701
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1702
+  (0.6ms) SAVEPOINT active_record_1
1703
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 279]]
1704
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 279]]
1705
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011329557"], ["lftp", 28657], ["lftq", 75025], ["name", ""], ["region_id", 279], ["rgt", "0.381966011794675"], ["rgtp", 10946], ["rgtq", 28657]]
1706
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1707
+  (0.5ms) SAVEPOINT active_record_1
1708
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 279]]
1709
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 279]]
1710
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011219757"], ["lftp", 46368], ["lftq", 121393], ["name", ""], ["region_id", 279], ["rgt", "0.381966011329557"], ["rgtp", 28657], ["rgtq", 75025]]
1711
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1712
+  (0.5ms) SAVEPOINT active_record_1
1713
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 281]]
1714
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 281]]
1715
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011261697"], ["lftp", 75025], ["lftq", 196418], ["name", ""], ["region_id", 281], ["rgt", "0.381966011329557"], ["rgtp", 28657], ["rgtq", 75025]]
1716
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1717
+  (0.6ms) SAVEPOINT active_record_1
1718
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 281]]
1719
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 281]]
1720
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011245677"], ["lftp", 121393], ["lftq", 317811], ["name", ""], ["region_id", 281], ["rgt", "0.381966011261697"], ["rgtp", 75025], ["rgtq", 196418]]
1721
+  (0.7ms) RELEASE SAVEPOINT active_record_1
1722
+  (0.6ms) SAVEPOINT active_record_1
1723
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 283]]
1724
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 283]]
1725
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011251796"], ["lftp", 196418], ["lftq", 514229], ["name", ""], ["region_id", 283], ["rgt", "0.381966011261697"], ["rgtp", 75025], ["rgtq", 196418]]
1726
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1727
+  (0.5ms) SAVEPOINT active_record_1
1728
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 283]]
1729
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 283]]
1730
+ SQL (1.2ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011249459"], ["lftp", 317811], ["lftq", 832040], ["name", ""], ["region_id", 283], ["rgt", "0.381966011251796"], ["rgtp", 196418], ["rgtq", 514229]]
1731
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1732
+  (0.5ms) SAVEPOINT active_record_1
1733
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 285]]
1734
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 285]]
1735
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250352"], ["lftp", 514229], ["lftq", 1346269], ["name", ""], ["region_id", 285], ["rgt", "0.381966011251796"], ["rgtp", 196418], ["rgtq", 514229]]
1736
+  (0.7ms) RELEASE SAVEPOINT active_record_1
1737
+  (0.5ms) SAVEPOINT active_record_1
1738
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 285]]
1739
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 285]]
1740
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250011"], ["lftp", 832040], ["lftq", 2178309], ["name", ""], ["region_id", 285], ["rgt", "0.381966011250352"], ["rgtp", 514229], ["rgtq", 1346269]]
1741
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1742
+  (0.6ms) SAVEPOINT active_record_1
1743
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 287]]
1744
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 287]]
1745
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250141"], ["lftp", 1346269], ["lftq", 3524578], ["name", ""], ["region_id", 287], ["rgt", "0.381966011250352"], ["rgtp", 514229], ["rgtq", 1346269]]
1746
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1747
+  (0.5ms) SAVEPOINT active_record_1
1748
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 287]]
1749
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 287]]
1750
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250091"], ["lftp", 2178309], ["lftq", 5702887], ["name", ""], ["region_id", 287], ["rgt", "0.381966011250141"], ["rgtp", 1346269], ["rgtq", 3524578]]
1751
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1752
+  (0.5ms) SAVEPOINT active_record_1
1753
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 289]]
1754
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 289]]
1755
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.38196601125011"], ["lftp", 3524578], ["lftq", 9227465], ["name", ""], ["region_id", 289], ["rgt", "0.381966011250141"], ["rgtp", 1346269], ["rgtq", 3524578]]
1756
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1757
+  (0.5ms) SAVEPOINT active_record_1
1758
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 289]]
1759
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 289]]
1760
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250103"], ["lftp", 5702887], ["lftq", 14930352], ["name", ""], ["region_id", 289], ["rgt", "0.38196601125011"], ["rgtp", 3524578], ["rgtq", 9227465]]
1761
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1762
+  (0.5ms) SAVEPOINT active_record_1
1763
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 291]]
1764
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 291]]
1765
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250106"], ["lftp", 9227465], ["lftq", 24157817], ["name", ""], ["region_id", 291], ["rgt", "0.38196601125011"], ["rgtp", 3524578], ["rgtq", 9227465]]
1766
+  (0.7ms) RELEASE SAVEPOINT active_record_1
1767
+  (0.6ms) SAVEPOINT active_record_1
1768
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 291]]
1769
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 291]]
1770
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 14930352], ["lftq", 39088169], ["name", ""], ["region_id", 291], ["rgt", "0.381966011250106"], ["rgtp", 9227465], ["rgtq", 24157817]]
1771
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1772
+  (1.5ms) SAVEPOINT active_record_1
1773
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 293]]
1774
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 293]]
1775
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 24157817], ["lftq", 63245986], ["name", ""], ["region_id", 293], ["rgt", "0.381966011250106"], ["rgtp", 9227465], ["rgtq", 24157817]]
1776
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1777
+  (0.5ms) SAVEPOINT active_record_1
1778
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 293]]
1779
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 293]]
1780
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 39088169], ["lftq", 102334155], ["name", ""], ["region_id", 293], ["rgt", "0.381966011250105"], ["rgtp", 24157817], ["rgtq", 63245986]]
1781
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1782
+  (0.5ms) SAVEPOINT active_record_1
1783
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 295]]
1784
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 295]]
1785
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 63245986], ["lftq", 165580141], ["name", ""], ["region_id", 295], ["rgt", "0.381966011250105"], ["rgtp", 24157817], ["rgtq", 63245986]]
1786
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1787
+  (0.6ms) SAVEPOINT active_record_1
1788
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 295]]
1789
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 295]]
1790
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 102334155], ["lftq", 267914296], ["name", ""], ["region_id", 295], ["rgt", "0.381966011250105"], ["rgtp", 63245986], ["rgtq", 165580141]]
1791
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1792
+  (0.6ms) SAVEPOINT active_record_1
1793
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 297]]
1794
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 297]]
1795
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 165580141], ["lftq", 433494437], ["name", ""], ["region_id", 297], ["rgt", "0.381966011250105"], ["rgtp", 63245986], ["rgtq", 165580141]]
1796
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1797
+  (0.6ms) SAVEPOINT active_record_1
1798
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 297]]
1799
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 297]]
1800
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 267914296], ["lftq", 701408733], ["name", ""], ["region_id", 297], ["rgt", "0.381966011250105"], ["rgtp", 165580141], ["rgtq", 433494437]]
1801
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1802
+  (0.5ms) SAVEPOINT active_record_1
1803
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 299]]
1804
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 299]]
1805
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 433494437], ["lftq", 1134903170], ["name", ""], ["region_id", 299], ["rgt", "0.381966011250105"], ["rgtp", 165580141], ["rgtq", 433494437]]
1806
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1807
+  (0.5ms) SAVEPOINT active_record_1
1808
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 299]]
1809
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 299]]
1810
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 701408733], ["lftq", 1836311903], ["name", ""], ["region_id", 299], ["rgt", "0.381966011250105"], ["rgtp", 433494437], ["rgtq", 1134903170]]
1811
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1812
+  (0.6ms) ROLLBACK
1813
+  (0.5ms) BEGIN
1814
+ ----------------------------------------------
1815
+ ActsAsNestedIntervalTest: test_modular_inverse
1816
+ ----------------------------------------------
1817
+  (0.6ms) ROLLBACK
1818
+  (0.5ms) BEGIN
1819
+ -----------------------------------
1820
+ ActsAsNestedIntervalTest: test_move
1821
+ -----------------------------------
1822
+  (0.6ms) SAVEPOINT active_record_1
1823
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1824
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1825
+  (0.5ms) SAVEPOINT active_record_1
1826
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 302]]
1827
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 302]]
1828
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 302], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1829
+  (1.1ms) RELEASE SAVEPOINT active_record_1
1830
+  (0.6ms) SAVEPOINT active_record_1
1831
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 303]]
1832
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 303]]
1833
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 303], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1834
+  (0.7ms) RELEASE SAVEPOINT active_record_1
1835
+  (0.5ms) SAVEPOINT active_record_1
1836
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 303]]
1837
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 303]]
1838
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 303], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
1839
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1840
+  (0.5ms) SAVEPOINT active_record_1
1841
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 303]]
1842
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 303]]
1843
+  (0.7ms) ROLLBACK TO SAVEPOINT active_record_1
1844
+  (0.5ms) SAVEPOINT active_record_1
1845
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 303]]
1846
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 304]]
1847
+  (0.8ms) ROLLBACK TO SAVEPOINT active_record_1
1848
+  (0.5ms) SAVEPOINT active_record_1
1849
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 302]]
1850
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 302]]
1851
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "Pacific"], ["region_id", 302], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
1852
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1853
+  (0.5ms) SAVEPOINT active_record_1
1854
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 303]]
1855
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 306]]
1856
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 306]]
1857
+ SQL (1.7ms) UPDATE "regions" SET rgtp = 0 * rgtp + 1 * rgtq, rgtq = -1 * rgtp + 3 * rgtq, rgt = 1.000000000000000000000000000000 * (0 * rgtp + 1 * rgtq) / (-1 * rgtp + 3 * rgtq), lftp = 0 * lftp + 1 * lftq, lftq = -1 * lftp + 3 * lftq, lft = 1.000000000000000000000000000000 * (0 * lftp + 1 * lftq) / (-1 * lftp + 3 * lftq) WHERE "regions"."fiction" = 'f' AND (lft > 0.5 AND rgt <= 1.0)
1858
+ SQL (1.0ms) UPDATE "regions" SET "lft" = $1, "lftp" = $2, "lftq" = $3, "region_id" = $4, "rgt" = $5, "rgtq" = $6 WHERE "regions"."id" = 303 [["lft", "0.4"], ["lftp", 2], ["lftq", 5], ["region_id", 306], ["rgt", "0.5"], ["rgtq", 2]]
1859
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1860
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 304]]
1861
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 305]]
1862
+  (0.8ms) ROLLBACK
1863
+  (0.6ms) BEGIN
1864
+ ------------------------------------------------------
1865
+ ActsAsNestedIntervalTest: test_move_from_left_to_right
1866
+ ------------------------------------------------------
1867
+  (0.6ms) SAVEPOINT active_record_1
1868
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1869
+  (0.8ms) RELEASE SAVEPOINT active_record_1
1870
+  (0.5ms) SAVEPOINT active_record_1
1871
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 307]]
1872
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 307]]
1873
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "europe"], ["region_id", 307], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1874
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1875
+  (0.6ms) SAVEPOINT active_record_1
1876
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 307]]
1877
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 307]]
1878
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "america"], ["region_id", 307], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
1879
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1880
+  (0.6ms) SAVEPOINT active_record_1
1881
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 309]]
1882
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 309]]
1883
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.4"], ["lftp", 2], ["lftq", 5], ["name", "usa"], ["region_id", 309], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
1884
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1885
+  (0.5ms) SAVEPOINT active_record_1
1886
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 310]]
1887
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 310]]
1888
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.428571428571429"], ["lftp", 3], ["lftq", 7], ["name", "texas"], ["region_id", 310], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
1889
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1890
+  (0.6ms) SAVEPOINT active_record_1
1891
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 311]]
1892
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 311]]
1893
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.444444444444444"], ["lftp", 4], ["lftq", 9], ["name", "houston"], ["region_id", 311], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
1894
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1895
+  (0.5ms) SAVEPOINT active_record_1
1896
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 311]]
1897
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 308]]
1898
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 308]]
1899
+ SQL (1.8ms) UPDATE "regions" SET rgtp = 3 * rgtp + -1 * rgtq, rgtq = 1 * rgtp + 0 * rgtq, rgt = 1.000000000000000000000000000000 * (3 * rgtp + -1 * rgtq) / (1 * rgtp + 0 * rgtq), lftp = 3 * lftp + -1 * lftq, lftq = 1 * lftp + 0 * lftq, lft = 1.000000000000000000000000000000 * (3 * lftp + -1 * lftq) / (1 * lftp + 0 * lftq) WHERE "regions"."fiction" = 'f' AND (lft > 0.42857142857142855 AND rgt <= 0.5)
1900
+ SQL (1.0ms) UPDATE "regions" SET "lft" = $1, "lftp" = $2, "lftq" = $3, "region_id" = $4, "rgt" = $5, "rgtq" = $6 WHERE "regions"."id" = 311 [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["region_id", 308], ["rgt", "1.0"], ["rgtq", 1]]
1901
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1902
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 312]]
1903
+  (1.1ms) SELECT COUNT(*) FROM "regions" WHERE "regions"."fiction" = 'f' AND (lft > 0.75 AND rgt <= 1.0)
1904
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 311]]
1905
+  (1.2ms) SELECT COUNT(*) FROM "regions" WHERE "regions"."fiction" = 'f' AND (lft > 0.6666666666666666 AND rgt <= 1.0)
1906
+  (0.7ms) ROLLBACK
1907
+  (0.5ms) BEGIN
1908
+ ---------------------------------------------------------------
1909
+ ActsAsNestedIntervalTest: test_move_to_root_recomputes_interval
1910
+ ---------------------------------------------------------------
1911
+  (0.6ms) SAVEPOINT active_record_1
1912
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1913
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Europe"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1914
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1915
+  (0.6ms) SAVEPOINT active_record_1
1916
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 313]]
1917
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 313]]
1918
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Romania"], ["region_id", 313], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1919
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1920
+  (1.1ms) SAVEPOINT active_record_1
1921
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1922
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "Asia"], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
1923
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1924
+  (0.5ms) SAVEPOINT active_record_1
1925
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1926
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["name", "America"], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
1927
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1928
+  (0.5ms) SAVEPOINT active_record_1
1929
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 314]]
1930
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1931
+ SQL (1.9ms) UPDATE "regions" SET rgtp = 2 * rgtp + -1 * rgtq, rgtq = 7 * rgtp + -3 * rgtq, rgt = 1.000000000000000000000000000000 * (2 * rgtp + -1 * rgtq) / (7 * rgtp + -3 * rgtq), lftp = 2 * lftp + -1 * lftq, lftq = 7 * lftp + -3 * lftq, lft = 1.000000000000000000000000000000 * (2 * lftp + -1 * lftq) / (7 * lftp + -3 * lftq) WHERE "regions"."fiction" = 'f' AND (lft > 0.6666666666666666 AND rgt <= 1.0)
1932
+ SQL (1.4ms) UPDATE "regions" SET "lft" = $1, "lftp" = $2, "lftq" = $3, "region_id" = $4, "rgt" = $5, "rgtq" = $6 WHERE "regions"."id" = 314 [["lft", "0.2"], ["lftp", 1], ["lftq", 5], ["region_id", nil], ["rgt", "0.25"], ["rgtq", 4]]
1933
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1934
+  (0.6ms) ROLLBACK
1935
+  (0.5ms) BEGIN
1936
+ ---------------------------------------
1937
+ ActsAsNestedIntervalTest: test_preorder
1938
+ ---------------------------------------
1939
+  (0.6ms) SAVEPOINT active_record_1
1940
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1941
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1942
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1943
+  (0.7ms) SAVEPOINT active_record_1
1944
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 317]]
1945
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 317]]
1946
+ SQL (2.3ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Oceania"], ["region_id", 317], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1947
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1948
+  (0.5ms) SAVEPOINT active_record_1
1949
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 317]]
1950
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 317]]
1951
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "Antarctica"], ["region_id", 317], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
1952
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1953
+  (0.6ms) SAVEPOINT active_record_1
1954
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 318]]
1955
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 318]]
1956
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.75"], ["lftp", 3], ["lftq", 4], ["name", "Australia"], ["region_id", 318], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1957
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1958
+  (0.5ms) SAVEPOINT active_record_1
1959
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 318]]
1960
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 318]]
1961
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.714285714285714"], ["lftp", 5], ["lftq", 7], ["name", "New Zealand"], ["region_id", 318], ["rgt", "0.75"], ["rgtp", 3], ["rgtq", 4]]
1962
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1963
+ Region Load (2.2ms) SELECT "regions".* FROM "regions" ORDER BY rgt DESC, lftp ASC
1964
+  (0.7ms) ROLLBACK
1965
+  (0.6ms) BEGIN
1966
+ -----------------------------------------------------------
1967
+ ActsAsNestedIntervalTest: test_rebuild_nested_interval_tree
1968
+ -----------------------------------------------------------
1969
+  (0.6ms) SAVEPOINT active_record_1
1970
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1971
+ SQL (1.3ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Europe"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1972
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1973
+  (0.5ms) SAVEPOINT active_record_1
1974
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 322]]
1975
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 322]]
1976
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Romania"], ["region_id", 322], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1977
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1978
+  (0.5ms) SAVEPOINT active_record_1
1979
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1980
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "Asia"], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
1981
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1982
+  (0.5ms) SAVEPOINT active_record_1
1983
+ Region Load (1.6ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1984
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["name", "America"], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
1985
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1986
+ SQL (1.3ms) UPDATE "regions" SET "lftp" = 0, "lftq" = 0, "rgtp" = 0, "rgtq" = 0, "lft" = 0, "rgt" = 0 WHERE ("regions".lftq > 0)
1987
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" IS NULL ORDER BY "regions"."id" ASC LIMIT 1000
1988
+ Region Load (1.6ms) SELECT "regions".* FROM "regions" WHERE ("regions".lftq > 0) AND "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
1989
+  (0.6ms) SAVEPOINT active_record_1
1990
+ SQL (1.1ms) UPDATE "regions" SET "lft" = $1, "lftp" = $2, "lftq" = $3, "rgt" = $4, "rgtp" = $5, "rgtq" = $6 WHERE "regions"."id" = 322 [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1991
+  (0.7ms) RELEASE SAVEPOINT active_record_1
1992
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = 322 ORDER BY "regions"."id" ASC LIMIT 1000
1993
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE ("regions".lftq > 0) AND "regions"."id" = $1 LIMIT 1 [["id", 322]]
1994
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 322]]
1995
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE ("regions".lftq > 0) AND "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 322]]
1996
+  (0.6ms) SAVEPOINT active_record_1
1997
+ SQL (1.2ms) UPDATE "regions" SET "lft" = $1, "lftp" = $2, "lftq" = $3, "rgt" = $4, "rgtp" = $5, "rgtq" = $6 WHERE "regions"."id" = 323 [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
1998
+  (0.6ms) RELEASE SAVEPOINT active_record_1
1999
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = 323 ORDER BY "regions"."id" ASC LIMIT 1000
2000
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE ("regions".lftq > 0) AND "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2001
+  (0.6ms) SAVEPOINT active_record_1
2002
+ SQL (1.0ms) UPDATE "regions" SET "lft" = $1, "lftp" = $2, "lftq" = $3, "rgt" = $4, "rgtp" = $5, "rgtq" = $6 WHERE "regions"."id" = 324 [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
2003
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2004
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = 324 ORDER BY "regions"."id" ASC LIMIT 1000
2005
+ Region Load (1.5ms) SELECT "regions".* FROM "regions" WHERE ("regions".lftq > 0) AND "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2006
+  (0.7ms) SAVEPOINT active_record_1
2007
+ SQL (1.2ms) UPDATE "regions" SET "lft" = $1, "lftp" = $2, "lftq" = $3, "rgt" = $4, "rgtp" = $5, "rgtq" = $6 WHERE "regions"."id" = 325 [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
2008
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2009
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = 325 ORDER BY "regions"."id" ASC LIMIT 1000
2010
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" ORDER BY rgt DESC, lftp ASC
2011
+  (0.6ms) ROLLBACK
2012
+  (0.6ms) BEGIN
2013
+ ---------------------------------------------------------
2014
+ ActsAsNestedIntervalTest: test_root_update_keeps_interval
2015
+ ---------------------------------------------------------
2016
+  (0.5ms) SAVEPOINT active_record_1
2017
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2018
+ SQL (1.2ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Europe"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2019
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2020
+  (0.5ms) SAVEPOINT active_record_1
2021
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 326]]
2022
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 326]]
2023
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Romania"], ["region_id", 326], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2024
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2025
+  (0.6ms) SAVEPOINT active_record_1
2026
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2027
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "Asia"], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
2028
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2029
+  (0.5ms) SAVEPOINT active_record_1
2030
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2031
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["name", "America"], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
2032
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2033
+  (0.5ms) SAVEPOINT active_record_1
2034
+ Region Load (3.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" IN (329, '---
2035
+ :lock: true
2036
+ ')
2037
+ PG::InvalidTextRepresentation: BŁĄD: nieprawidłowa składnia wejścia dla integer: "---
2038
+ :lock: true
2039
+ "
2040
+ LINE 1: ...egions".* FROM "regions" WHERE "regions"."id" IN (329, '---
2041
+ ^
2042
+ : SELECT "regions".* FROM "regions" WHERE "regions"."id" IN (329, '---
2043
+ :lock: true
2044
+ ')
2045
+  (0.6ms) ROLLBACK TO SAVEPOINT active_record_1
2046
+  (0.6ms) ROLLBACK
2047
+  (0.5ms) BEGIN
2048
+ ------------------------------------
2049
+ ActsAsNestedIntervalTest: test_scope
2050
+ ------------------------------------
2051
+  (0.5ms) SAVEPOINT active_record_1
2052
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2053
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2054
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2055
+  (0.6ms) SAVEPOINT active_record_1
2056
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 330]]
2057
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 330]]
2058
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Oceania"], ["region_id", 330], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2059
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2060
+  (0.5ms) SAVEPOINT active_record_1
2061
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 't' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2062
+ SQL (1.0ms) INSERT INTO "regions" ("fiction", "lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["fiction", "t"], ["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Krypton"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2063
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2064
+ Region Load (1.4ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (0 = 1 OR lftq = 2 AND lftp = 1 OR lftq = 1 AND lftp = 0)
2065
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 't' AND (lft > 0.5 AND rgt <= 1.0)
2066
+  (0.7ms) ROLLBACK
2067
+  (0.5ms) BEGIN
2068
+ ------------------------------------------------------
2069
+ ActsAsNestedIntervalTest: test_virtual_root_allocation
2070
+ ------------------------------------------------------
2071
+  (0.5ms) SAVEPOINT active_record_1
2072
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2073
+ SQL (2.2ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Europe"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2074
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2075
+  (0.5ms) SAVEPOINT active_record_1
2076
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 333]]
2077
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 333]]
2078
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Romania"], ["region_id", 333], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2079
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2080
+  (0.6ms) SAVEPOINT active_record_1
2081
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2082
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "Asia"], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
2083
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2084
+  (0.5ms) SAVEPOINT active_record_1
2085
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2086
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["name", "America"], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
2087
+  (0.7ms) RELEASE SAVEPOINT active_record_1
2088
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" ORDER BY rgt DESC, lftp ASC
2089
+  (0.6ms) ROLLBACK
2090
+  (0.5ms) BEGIN
2091
+ -------------------------------------------------
2092
+ ActsAsNestedIntervalTest: test_virtual_root_order
2093
+ -------------------------------------------------
2094
+  (0.5ms) SAVEPOINT active_record_1
2095
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2096
+ SQL (2.5ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "1"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2097
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2098
+  (0.6ms) SAVEPOINT active_record_1
2099
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2100
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "2"], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
2101
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2102
+  (0.6ms) SAVEPOINT active_record_1
2103
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2104
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["name", "3"], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
2105
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2106
+  (0.6ms) ROLLBACK
2107
+ ActiveRecord::SchemaMigration Load (1.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
2108
+  (0.6ms) BEGIN
2109
+ ----------------------------------------
2110
+ ActsAsNestedIntervalTest: test_ancestors
2111
+ ----------------------------------------
2112
+  (0.6ms) SAVEPOINT active_record_1
2113
+ SQL (1.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2114
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2115
+  (0.5ms) SAVEPOINT active_record_1
2116
+ Region Load (1.5ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 340]]
2117
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 340]]
2118
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 340], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2119
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2120
+  (0.6ms) SAVEPOINT active_record_1
2121
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 341]]
2122
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 341]]
2123
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 341], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2124
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2125
+  (0.5ms) SAVEPOINT active_record_1
2126
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 341]]
2127
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 341]]
2128
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 341], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
2129
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2130
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (0 = 1)
2131
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (0 = 1 OR lftq = 1 AND lftp = 0)
2132
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (0 = 1 OR lftq = 2 AND lftp = 1 OR lftq = 1 AND lftp = 0)
2133
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (0 = 1 OR lftq = 2 AND lftp = 1 OR lftq = 1 AND lftp = 0)
2134
+  (0.7ms) ROLLBACK
2135
+  (0.5ms) BEGIN
2136
+ -------------------------------------------
2137
+ ActsAsNestedIntervalTest: test_append_child
2138
+ -------------------------------------------
2139
+  (0.5ms) SAVEPOINT active_record_1
2140
+ SQL (1.2ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2141
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2142
+  (0.5ms) SAVEPOINT active_record_1
2143
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 344]]
2144
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 344]]
2145
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 344]]
2146
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 344], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2147
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2148
+  (1.2ms) ROLLBACK
2149
+  (0.5ms) BEGIN
2150
+ -------------------------------------------------
2151
+ ActsAsNestedIntervalTest: test_create_first_child
2152
+ -------------------------------------------------
2153
+  (0.5ms) SAVEPOINT active_record_1
2154
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2155
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 346]]
2156
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 346]]
2157
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 346], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2158
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2159
+  (0.6ms) ROLLBACK
2160
+  (0.5ms) BEGIN
2161
+ ------------------------------------------
2162
+ ActsAsNestedIntervalTest: test_create_root
2163
+ ------------------------------------------
2164
+  (0.5ms) SAVEPOINT active_record_1
2165
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2166
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2167
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" IS NULL
2168
+  (0.6ms) ROLLBACK
2169
+  (0.5ms) BEGIN
2170
+ --------------------------------------------------
2171
+ ActsAsNestedIntervalTest: test_create_second_child
2172
+ --------------------------------------------------
2173
+  (0.6ms) SAVEPOINT active_record_1
2174
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2175
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2176
+  (0.6ms) SAVEPOINT active_record_1
2177
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 349]]
2178
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 349]]
2179
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 349], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2180
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2181
+  (0.5ms) SAVEPOINT active_record_1
2182
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 350]]
2183
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 350]]
2184
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 350], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2185
+  (1.2ms) RELEASE SAVEPOINT active_record_1
2186
+  (0.5ms) SAVEPOINT active_record_1
2187
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 350]]
2188
+ Region Load (2.7ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 350]]
2189
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 350], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
2190
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2191
+  (0.6ms) ROLLBACK
2192
+  (0.5ms) BEGIN
2193
+ -------------------------------------------------
2194
+ ActsAsNestedIntervalTest: test_database_precision
2195
+ -------------------------------------------------
2196
+  (0.6ms) SAVEPOINT active_record_1
2197
+ SQL (1.3ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "root"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2198
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2199
+  (0.5ms) SAVEPOINT active_record_1
2200
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 353]]
2201
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 353]]
2202
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "l1"], ["region_id", 353], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2203
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2204
+  (0.5ms) SAVEPOINT active_record_1
2205
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 354]]
2206
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 354]]
2207
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "l2"], ["region_id", 354], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2208
+  (0.9ms) RELEASE SAVEPOINT active_record_1
2209
+  (0.6ms) SAVEPOINT active_record_1
2210
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 355]]
2211
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 355]]
2212
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.75"], ["lftp", 3], ["lftq", 4], ["name", "l3"], ["region_id", 355], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2213
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2214
+  (0.9ms) SAVEPOINT active_record_1
2215
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 356]]
2216
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 356]]
2217
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.8"], ["lftp", 4], ["lftq", 5], ["name", "l4"], ["region_id", 356], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2218
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2219
+  (0.5ms) SAVEPOINT active_record_1
2220
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 356]]
2221
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 354]]
2222
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 354]]
2223
+ SQL (3.2ms) UPDATE "regions" SET rgtp = 5 * rgtp + -3 * rgtq, rgtq = 7 * rgtp + -4 * rgtq, rgt = 1.000000000000000000000000000000 * (5 * rgtp + -3 * rgtq) / (7 * rgtp + -4 * rgtq), lftp = 5 * lftp + -3 * lftq, lftq = 7 * lftp + -4 * lftq, lft = 1.000000000000000000000000000000 * (5 * lftp + -3 * lftq) / (7 * lftp + -4 * lftq) WHERE "regions"."fiction" = 'f' AND (lftp > 3 AND lft BETWEEN 0.75 AND 1.0)
2224
+ SQL (1.1ms) UPDATE "regions" SET "lft" = $1, "lftq" = $2, "region_id" = $3, "rgt" = $4, "rgtp" = $5, "rgtq" = $6 WHERE "regions"."id" = 356 [["lft", "0.6"], ["lftq", 5], ["region_id", 354], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
2225
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2226
+  (2.3ms) SELECT COUNT(*) FROM "regions" WHERE (abs(rgt - (select rgt from regions where id =356)) < 1e-16)
2227
+  (0.8ms) ROLLBACK
2228
+  (0.5ms) BEGIN
2229
+ ------------------------------------
2230
+ ActsAsNestedIntervalTest: test_depth
2231
+ ------------------------------------
2232
+  (0.6ms) SAVEPOINT active_record_1
2233
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2234
+  (0.7ms) RELEASE SAVEPOINT active_record_1
2235
+  (0.5ms) SAVEPOINT active_record_1
2236
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 358]]
2237
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 358]]
2238
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 358], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2239
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2240
+  (0.6ms) SAVEPOINT active_record_1
2241
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 359]]
2242
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 359]]
2243
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 359], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2244
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2245
+  (0.6ms) SAVEPOINT active_record_1
2246
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 359]]
2247
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 359]]
2248
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 359], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
2249
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2250
+  (0.7ms) ROLLBACK
2251
+  (0.5ms) BEGIN
2252
+ ------------------------------------------
2253
+ ActsAsNestedIntervalTest: test_descendants
2254
+ ------------------------------------------
2255
+  (0.5ms) SAVEPOINT active_record_1
2256
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2257
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2258
+  (0.5ms) SAVEPOINT active_record_1
2259
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 362]]
2260
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 362]]
2261
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 362], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2262
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2263
+  (0.6ms) SAVEPOINT active_record_1
2264
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 363]]
2265
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 363]]
2266
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 363], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2267
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2268
+  (0.5ms) SAVEPOINT active_record_1
2269
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 363]]
2270
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 363]]
2271
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 363], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
2272
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2273
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (lftp > 0 AND lft BETWEEN 0.0 AND 1.0)
2274
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (lftp > 1 AND lft BETWEEN 0.5 AND 1.0)
2275
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (lftp > 2 AND lft BETWEEN 0.6666666666666666 AND 1.0)
2276
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (lftp > 3 AND lft BETWEEN 0.6 AND 0.6666666666666666)
2277
+  (0.6ms) ROLLBACK
2278
+  (0.5ms) BEGIN
2279
+ --------------------------------------
2280
+ ActsAsNestedIntervalTest: test_destroy
2281
+ --------------------------------------
2282
+  (0.5ms) SAVEPOINT active_record_1
2283
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2284
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2285
+  (0.5ms) SAVEPOINT active_record_1
2286
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 366]]
2287
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 366]]
2288
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 366], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2289
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2290
+  (0.5ms) SAVEPOINT active_record_1
2291
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 367]]
2292
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 367]]
2293
+ SQL (1.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 367], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2294
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2295
+  (0.5ms) SAVEPOINT active_record_1
2296
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 367]]
2297
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 367]]
2298
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 367], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
2299
+  (0.8ms) RELEASE SAVEPOINT active_record_1
2300
+  (0.5ms) SAVEPOINT active_record_1
2301
+ Region Exists (0.9ms) SELECT 1 AS one FROM "regions" WHERE "regions"."region_id" = $1 LIMIT 1 [["region_id", 367]]
2302
+  (0.6ms) ROLLBACK TO SAVEPOINT active_record_1
2303
+  (0.7ms) ROLLBACK
2304
+  (0.5ms) BEGIN
2305
+ -------------------------------------
2306
+ ActsAsNestedIntervalTest: test_limits
2307
+ -------------------------------------
2308
+  (0.6ms) SAVEPOINT active_record_1
2309
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", ""], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2310
+  (0.8ms) RELEASE SAVEPOINT active_record_1
2311
+  (0.8ms) SAVEPOINT active_record_1
2312
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 370]]
2313
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 370]]
2314
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", ""], ["region_id", 370], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2315
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2316
+  (1.3ms) SAVEPOINT active_record_1
2317
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 370]]
2318
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 370]]
2319
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", ""], ["region_id", 370], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
2320
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2321
+  (1.4ms) SAVEPOINT active_record_1
2322
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 372]]
2323
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 372]]
2324
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.4"], ["lftp", 2], ["lftq", 5], ["name", ""], ["region_id", 372], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
2325
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2326
+  (0.5ms) SAVEPOINT active_record_1
2327
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 372]]
2328
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 372]]
2329
+ SQL (1.3ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.375"], ["lftp", 3], ["lftq", 8], ["name", ""], ["region_id", 372], ["rgt", "0.4"], ["rgtp", 2], ["rgtq", 5]]
2330
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2331
+  (0.5ms) SAVEPOINT active_record_1
2332
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 374]]
2333
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 374]]
2334
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.384615384615385"], ["lftp", 5], ["lftq", 13], ["name", ""], ["region_id", 374], ["rgt", "0.4"], ["rgtp", 2], ["rgtq", 5]]
2335
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2336
+  (0.5ms) SAVEPOINT active_record_1
2337
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 374]]
2338
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 374]]
2339
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.380952380952381"], ["lftp", 8], ["lftq", 21], ["name", ""], ["region_id", 374], ["rgt", "0.384615384615385"], ["rgtp", 5], ["rgtq", 13]]
2340
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2341
+  (0.6ms) SAVEPOINT active_record_1
2342
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 376]]
2343
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 376]]
2344
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.382352941176471"], ["lftp", 13], ["lftq", 34], ["name", ""], ["region_id", 376], ["rgt", "0.384615384615385"], ["rgtp", 5], ["rgtq", 13]]
2345
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2346
+  (0.6ms) SAVEPOINT active_record_1
2347
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 376]]
2348
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 376]]
2349
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381818181818182"], ["lftp", 21], ["lftq", 55], ["name", ""], ["region_id", 376], ["rgt", "0.382352941176471"], ["rgtp", 13], ["rgtq", 34]]
2350
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2351
+  (0.5ms) SAVEPOINT active_record_1
2352
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 378]]
2353
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 378]]
2354
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.382022471910112"], ["lftp", 34], ["lftq", 89], ["name", ""], ["region_id", 378], ["rgt", "0.382352941176471"], ["rgtp", 13], ["rgtq", 34]]
2355
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2356
+  (0.5ms) SAVEPOINT active_record_1
2357
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 378]]
2358
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 378]]
2359
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381944444444444"], ["lftp", 55], ["lftq", 144], ["name", ""], ["region_id", 378], ["rgt", "0.382022471910112"], ["rgtp", 34], ["rgtq", 89]]
2360
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2361
+  (0.5ms) SAVEPOINT active_record_1
2362
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 380]]
2363
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 380]]
2364
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381974248927039"], ["lftp", 89], ["lftq", 233], ["name", ""], ["region_id", 380], ["rgt", "0.382022471910112"], ["rgtp", 34], ["rgtq", 89]]
2365
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2366
+  (0.5ms) SAVEPOINT active_record_1
2367
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 380]]
2368
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 380]]
2369
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381962864721485"], ["lftp", 144], ["lftq", 377], ["name", ""], ["region_id", 380], ["rgt", "0.381974248927039"], ["rgtp", 89], ["rgtq", 233]]
2370
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2371
+  (0.6ms) SAVEPOINT active_record_1
2372
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 382]]
2373
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 382]]
2374
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381967213114754"], ["lftp", 233], ["lftq", 610], ["name", ""], ["region_id", 382], ["rgt", "0.381974248927039"], ["rgtp", 89], ["rgtq", 233]]
2375
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2376
+  (0.6ms) SAVEPOINT active_record_1
2377
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 382]]
2378
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 382]]
2379
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381965552178318"], ["lftp", 377], ["lftq", 987], ["name", ""], ["region_id", 382], ["rgt", "0.381967213114754"], ["rgtp", 233], ["rgtq", 610]]
2380
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2381
+  (0.5ms) SAVEPOINT active_record_1
2382
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 384]]
2383
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 384]]
2384
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966186599875"], ["lftp", 610], ["lftq", 1597], ["name", ""], ["region_id", 384], ["rgt", "0.381967213114754"], ["rgtp", 233], ["rgtq", 610]]
2385
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2386
+  (0.5ms) SAVEPOINT active_record_1
2387
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 384]]
2388
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 384]]
2389
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381965944272446"], ["lftp", 987], ["lftq", 2584], ["name", ""], ["region_id", 384], ["rgt", "0.381966186599875"], ["rgtp", 610], ["rgtq", 1597]]
2390
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2391
+  (0.5ms) SAVEPOINT active_record_1
2392
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 386]]
2393
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 386]]
2394
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966036833293"], ["lftp", 1597], ["lftq", 4181], ["name", ""], ["region_id", 386], ["rgt", "0.381966186599875"], ["rgtp", 610], ["rgtq", 1597]]
2395
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2396
+  (0.5ms) SAVEPOINT active_record_1
2397
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 386]]
2398
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 386]]
2399
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966001478197"], ["lftp", 2584], ["lftq", 6765], ["name", ""], ["region_id", 386], ["rgt", "0.381966036833293"], ["rgtp", 1597], ["rgtq", 4181]]
2400
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2401
+  (0.6ms) SAVEPOINT active_record_1
2402
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 388]]
2403
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 388]]
2404
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966014982642"], ["lftp", 4181], ["lftq", 10946], ["name", ""], ["region_id", 388], ["rgt", "0.381966036833293"], ["rgtp", 1597], ["rgtq", 4181]]
2405
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2406
+  (0.5ms) SAVEPOINT active_record_1
2407
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 388]]
2408
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 388]]
2409
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966009824403"], ["lftp", 6765], ["lftq", 17711], ["name", ""], ["region_id", 388], ["rgt", "0.381966014982642"], ["rgtp", 4181], ["rgtq", 10946]]
2410
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2411
+  (0.5ms) SAVEPOINT active_record_1
2412
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 390]]
2413
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 390]]
2414
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011794675"], ["lftp", 10946], ["lftq", 28657], ["name", ""], ["region_id", 390], ["rgt", "0.381966014982642"], ["rgtp", 4181], ["rgtq", 10946]]
2415
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2416
+  (0.5ms) SAVEPOINT active_record_1
2417
+ Region Load (1.4ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 390]]
2418
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 390]]
2419
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011042098"], ["lftp", 17711], ["lftq", 46368], ["name", ""], ["region_id", 390], ["rgt", "0.381966011794675"], ["rgtp", 10946], ["rgtq", 28657]]
2420
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2421
+  (0.6ms) SAVEPOINT active_record_1
2422
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 392]]
2423
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 392]]
2424
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011329557"], ["lftp", 28657], ["lftq", 75025], ["name", ""], ["region_id", 392], ["rgt", "0.381966011794675"], ["rgtp", 10946], ["rgtq", 28657]]
2425
+  (1.8ms) RELEASE SAVEPOINT active_record_1
2426
+  (0.5ms) SAVEPOINT active_record_1
2427
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 392]]
2428
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 392]]
2429
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011219757"], ["lftp", 46368], ["lftq", 121393], ["name", ""], ["region_id", 392], ["rgt", "0.381966011329557"], ["rgtp", 28657], ["rgtq", 75025]]
2430
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2431
+  (0.7ms) SAVEPOINT active_record_1
2432
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 394]]
2433
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 394]]
2434
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011261697"], ["lftp", 75025], ["lftq", 196418], ["name", ""], ["region_id", 394], ["rgt", "0.381966011329557"], ["rgtp", 28657], ["rgtq", 75025]]
2435
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2436
+  (0.6ms) SAVEPOINT active_record_1
2437
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 394]]
2438
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 394]]
2439
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011245677"], ["lftp", 121393], ["lftq", 317811], ["name", ""], ["region_id", 394], ["rgt", "0.381966011261697"], ["rgtp", 75025], ["rgtq", 196418]]
2440
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2441
+  (0.5ms) SAVEPOINT active_record_1
2442
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 396]]
2443
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 396]]
2444
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011251796"], ["lftp", 196418], ["lftq", 514229], ["name", ""], ["region_id", 396], ["rgt", "0.381966011261697"], ["rgtp", 75025], ["rgtq", 196418]]
2445
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2446
+  (0.5ms) SAVEPOINT active_record_1
2447
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 396]]
2448
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 396]]
2449
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011249459"], ["lftp", 317811], ["lftq", 832040], ["name", ""], ["region_id", 396], ["rgt", "0.381966011251796"], ["rgtp", 196418], ["rgtq", 514229]]
2450
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2451
+  (0.5ms) SAVEPOINT active_record_1
2452
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 398]]
2453
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 398]]
2454
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250352"], ["lftp", 514229], ["lftq", 1346269], ["name", ""], ["region_id", 398], ["rgt", "0.381966011251796"], ["rgtp", 196418], ["rgtq", 514229]]
2455
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2456
+  (0.6ms) SAVEPOINT active_record_1
2457
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 398]]
2458
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 398]]
2459
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250011"], ["lftp", 832040], ["lftq", 2178309], ["name", ""], ["region_id", 398], ["rgt", "0.381966011250352"], ["rgtp", 514229], ["rgtq", 1346269]]
2460
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2461
+  (0.5ms) SAVEPOINT active_record_1
2462
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 400]]
2463
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 400]]
2464
+ SQL (1.5ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250141"], ["lftp", 1346269], ["lftq", 3524578], ["name", ""], ["region_id", 400], ["rgt", "0.381966011250352"], ["rgtp", 514229], ["rgtq", 1346269]]
2465
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2466
+  (0.5ms) SAVEPOINT active_record_1
2467
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 400]]
2468
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 400]]
2469
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250091"], ["lftp", 2178309], ["lftq", 5702887], ["name", ""], ["region_id", 400], ["rgt", "0.381966011250141"], ["rgtp", 1346269], ["rgtq", 3524578]]
2470
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2471
+  (0.6ms) SAVEPOINT active_record_1
2472
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 402]]
2473
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 402]]
2474
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.38196601125011"], ["lftp", 3524578], ["lftq", 9227465], ["name", ""], ["region_id", 402], ["rgt", "0.381966011250141"], ["rgtp", 1346269], ["rgtq", 3524578]]
2475
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2476
+  (0.5ms) SAVEPOINT active_record_1
2477
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 402]]
2478
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 402]]
2479
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250103"], ["lftp", 5702887], ["lftq", 14930352], ["name", ""], ["region_id", 402], ["rgt", "0.38196601125011"], ["rgtp", 3524578], ["rgtq", 9227465]]
2480
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2481
+  (0.5ms) SAVEPOINT active_record_1
2482
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 404]]
2483
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 404]]
2484
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250106"], ["lftp", 9227465], ["lftq", 24157817], ["name", ""], ["region_id", 404], ["rgt", "0.38196601125011"], ["rgtp", 3524578], ["rgtq", 9227465]]
2485
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2486
+  (0.5ms) SAVEPOINT active_record_1
2487
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 404]]
2488
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 404]]
2489
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 14930352], ["lftq", 39088169], ["name", ""], ["region_id", 404], ["rgt", "0.381966011250106"], ["rgtp", 9227465], ["rgtq", 24157817]]
2490
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2491
+  (0.5ms) SAVEPOINT active_record_1
2492
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 406]]
2493
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 406]]
2494
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 24157817], ["lftq", 63245986], ["name", ""], ["region_id", 406], ["rgt", "0.381966011250106"], ["rgtp", 9227465], ["rgtq", 24157817]]
2495
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2496
+  (0.5ms) SAVEPOINT active_record_1
2497
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 406]]
2498
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 406]]
2499
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 39088169], ["lftq", 102334155], ["name", ""], ["region_id", 406], ["rgt", "0.381966011250105"], ["rgtp", 24157817], ["rgtq", 63245986]]
2500
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2501
+  (0.7ms) SAVEPOINT active_record_1
2502
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 408]]
2503
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 408]]
2504
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 63245986], ["lftq", 165580141], ["name", ""], ["region_id", 408], ["rgt", "0.381966011250105"], ["rgtp", 24157817], ["rgtq", 63245986]]
2505
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2506
+  (0.6ms) SAVEPOINT active_record_1
2507
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 408]]
2508
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 408]]
2509
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 102334155], ["lftq", 267914296], ["name", ""], ["region_id", 408], ["rgt", "0.381966011250105"], ["rgtp", 63245986], ["rgtq", 165580141]]
2510
+  (0.7ms) RELEASE SAVEPOINT active_record_1
2511
+  (0.6ms) SAVEPOINT active_record_1
2512
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 410]]
2513
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 410]]
2514
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 165580141], ["lftq", 433494437], ["name", ""], ["region_id", 410], ["rgt", "0.381966011250105"], ["rgtp", 63245986], ["rgtq", 165580141]]
2515
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2516
+  (0.5ms) SAVEPOINT active_record_1
2517
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 410]]
2518
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 410]]
2519
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 267914296], ["lftq", 701408733], ["name", ""], ["region_id", 410], ["rgt", "0.381966011250105"], ["rgtp", 165580141], ["rgtq", 433494437]]
2520
+  (1.0ms) RELEASE SAVEPOINT active_record_1
2521
+  (0.5ms) SAVEPOINT active_record_1
2522
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 412]]
2523
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 412]]
2524
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 433494437], ["lftq", 1134903170], ["name", ""], ["region_id", 412], ["rgt", "0.381966011250105"], ["rgtp", 165580141], ["rgtq", 433494437]]
2525
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2526
+  (0.5ms) SAVEPOINT active_record_1
2527
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 412]]
2528
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 412]]
2529
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.381966011250105"], ["lftp", 701408733], ["lftq", 1836311903], ["name", ""], ["region_id", 412], ["rgt", "0.381966011250105"], ["rgtp", 433494437], ["rgtq", 1134903170]]
2530
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2531
+  (1.7ms) ROLLBACK
2532
+  (0.7ms) BEGIN
2533
+ ----------------------------------------------
2534
+ ActsAsNestedIntervalTest: test_modular_inverse
2535
+ ----------------------------------------------
2536
+  (0.6ms) ROLLBACK
2537
+  (0.5ms) BEGIN
2538
+ -----------------------------------
2539
+ ActsAsNestedIntervalTest: test_move
2540
+ -----------------------------------
2541
+  (0.5ms) SAVEPOINT active_record_1
2542
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2543
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2544
+  (0.5ms) SAVEPOINT active_record_1
2545
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 415]]
2546
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 415]]
2547
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Oceania"], ["region_id", 415], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2548
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2549
+  (0.6ms) SAVEPOINT active_record_1
2550
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 416]]
2551
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 416]]
2552
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Australia"], ["region_id", 416], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2553
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2554
+  (0.5ms) SAVEPOINT active_record_1
2555
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 416]]
2556
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 416]]
2557
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "New Zealand"], ["region_id", 416], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
2558
+  (1.6ms) RELEASE SAVEPOINT active_record_1
2559
+  (0.6ms) SAVEPOINT active_record_1
2560
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 416]]
2561
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 416]]
2562
+  (0.6ms) ROLLBACK TO SAVEPOINT active_record_1
2563
+  (0.5ms) SAVEPOINT active_record_1
2564
+ Region Load (1.0ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 416]]
2565
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 417]]
2566
+  (0.6ms) ROLLBACK TO SAVEPOINT active_record_1
2567
+  (0.8ms) SAVEPOINT active_record_1
2568
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 415]]
2569
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 415]]
2570
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "Pacific"], ["region_id", 415], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
2571
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2572
+  (0.5ms) SAVEPOINT active_record_1
2573
+ Region Load (1.5ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 416]]
2574
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 419]]
2575
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 419]]
2576
+ SQL (1.7ms) UPDATE "regions" SET rgtp = 0 * rgtp + 1 * rgtq, rgtq = -1 * rgtp + 3 * rgtq, rgt = 1.000000000000000000000000000000 * (0 * rgtp + 1 * rgtq) / (-1 * rgtp + 3 * rgtq), lftp = 0 * lftp + 1 * lftq, lftq = -1 * lftp + 3 * lftq, lft = 1.000000000000000000000000000000 * (0 * lftp + 1 * lftq) / (-1 * lftp + 3 * lftq) WHERE "regions"."fiction" = 'f' AND (lftp > 1 AND lft BETWEEN 0.5 AND 1.0)
2577
+ SQL (1.3ms) UPDATE "regions" SET "lft" = $1, "lftp" = $2, "lftq" = $3, "region_id" = $4, "rgt" = $5, "rgtq" = $6 WHERE "regions"."id" = 416 [["lft", "0.4"], ["lftp", 2], ["lftq", 5], ["region_id", 419], ["rgt", "0.5"], ["rgtq", 2]]
2578
+  (0.7ms) RELEASE SAVEPOINT active_record_1
2579
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 417]]
2580
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 418]]
2581
+  (0.7ms) ROLLBACK
2582
+  (0.5ms) BEGIN
2583
+ ------------------------------------------------------
2584
+ ActsAsNestedIntervalTest: test_move_from_left_to_right
2585
+ ------------------------------------------------------
2586
+  (0.5ms) SAVEPOINT active_record_1
2587
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.0"], ["lftp", 0], ["lftq", 1], ["name", "earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2588
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2589
+  (0.5ms) SAVEPOINT active_record_1
2590
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 420]]
2591
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 420]]
2592
+ SQL (1.6ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "europe"], ["region_id", 420], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2593
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2594
+  (0.6ms) SAVEPOINT active_record_1
2595
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 420]]
2596
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 420]]
2597
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "america"], ["region_id", 420], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
2598
+  (0.8ms) RELEASE SAVEPOINT active_record_1
2599
+  (0.5ms) SAVEPOINT active_record_1
2600
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 422]]
2601
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 422]]
2602
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.4"], ["lftp", 2], ["lftq", 5], ["name", "usa"], ["region_id", 422], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
2603
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2604
+  (0.7ms) SAVEPOINT active_record_1
2605
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 423]]
2606
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 423]]
2607
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.428571428571429"], ["lftp", 3], ["lftq", 7], ["name", "texas"], ["region_id", 423], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
2608
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2609
+  (0.5ms) SAVEPOINT active_record_1
2610
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 424]]
2611
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 424]]
2612
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.444444444444444"], ["lftp", 4], ["lftq", 9], ["name", "houston"], ["region_id", 424], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
2613
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2614
+  (0.6ms) SAVEPOINT active_record_1
2615
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 424]]
2616
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 421]]
2617
+ Region Load (0.7ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 421]]
2618
+ SQL (1.7ms) UPDATE "regions" SET rgtp = 3 * rgtp + -1 * rgtq, rgtq = 1 * rgtp + 0 * rgtq, rgt = 1.000000000000000000000000000000 * (3 * rgtp + -1 * rgtq) / (1 * rgtp + 0 * rgtq), lftp = 3 * lftp + -1 * lftq, lftq = 1 * lftp + 0 * lftq, lft = 1.000000000000000000000000000000 * (3 * lftp + -1 * lftq) / (1 * lftp + 0 * lftq) WHERE "regions"."fiction" = 'f' AND (lftp > 3 AND lft BETWEEN 0.42857142857142855 AND 0.5)
2619
+ SQL (1.1ms) UPDATE "regions" SET "lft" = $1, "lftp" = $2, "lftq" = $3, "region_id" = $4, "rgt" = $5, "rgtq" = $6 WHERE "regions"."id" = 424 [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["region_id", 421], ["rgt", "1.0"], ["rgtq", 1]]
2620
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2621
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 425]]
2622
+  (1.2ms) SELECT COUNT(*) FROM "regions" WHERE "regions"."fiction" = 'f' AND (lftp > 3 AND lft BETWEEN 0.75 AND 1.0)
2623
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 424]]
2624
+  (1.2ms) SELECT COUNT(*) FROM "regions" WHERE "regions"."fiction" = 'f' AND (lftp > 2 AND lft BETWEEN 0.6666666666666666 AND 1.0)
2625
+ Region Load (6.7ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 421]]
2626
+  (1.3ms) SELECT COUNT(*) FROM "regions" WHERE "regions"."fiction" = 'f' AND (lftp > 1 AND lft BETWEEN 0.5 AND 1.0)
2627
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 422]]
2628
+  (1.1ms) SELECT COUNT(*) FROM "regions" WHERE "regions"."fiction" = 'f' AND (lftp > 1 AND lft BETWEEN 0.3333333333333333 AND 0.5)
2629
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 423]]
2630
+  (1.1ms) SELECT COUNT(*) FROM "regions" WHERE "regions"."fiction" = 'f' AND (lftp > 2 AND lft BETWEEN 0.4 AND 0.5)
2631
+ Region Load (0.7ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 420]]
2632
+  (1.2ms) SELECT COUNT(*) FROM "regions" WHERE "regions"."fiction" = 'f' AND (lftp > 0 AND lft BETWEEN 0.0 AND 1.0)
2633
+  (0.6ms) ROLLBACK
2634
+  (0.6ms) BEGIN
2635
+ ---------------------------------------------------------------
2636
+ ActsAsNestedIntervalTest: test_move_to_root_recomputes_interval
2637
+ ---------------------------------------------------------------
2638
+  (0.6ms) SAVEPOINT active_record_1
2639
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2640
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Europe"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2641
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2642
+  (0.6ms) SAVEPOINT active_record_1
2643
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 426]]
2644
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 426]]
2645
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Romania"], ["region_id", 426], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2646
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2647
+  (0.5ms) SAVEPOINT active_record_1
2648
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2649
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "Asia"], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
2650
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2651
+  (0.5ms) SAVEPOINT active_record_1
2652
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2653
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["name", "America"], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
2654
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2655
+  (0.5ms) SAVEPOINT active_record_1
2656
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 [["id", 427]]
2657
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2658
+ SQL (1.6ms) UPDATE "regions" SET rgtp = 2 * rgtp + -1 * rgtq, rgtq = 7 * rgtp + -3 * rgtq, rgt = 1.000000000000000000000000000000 * (2 * rgtp + -1 * rgtq) / (7 * rgtp + -3 * rgtq), lftp = 2 * lftp + -1 * lftq, lftq = 7 * lftp + -3 * lftq, lft = 1.000000000000000000000000000000 * (2 * lftp + -1 * lftq) / (7 * lftp + -3 * lftq) WHERE "regions"."fiction" = 'f' AND (lftp > 2 AND lft BETWEEN 0.6666666666666666 AND 1.0)
2659
+ SQL (1.1ms) UPDATE "regions" SET "lft" = $1, "lftp" = $2, "lftq" = $3, "region_id" = $4, "rgt" = $5, "rgtq" = $6 WHERE "regions"."id" = 427 [["lft", "0.2"], ["lftp", 1], ["lftq", 5], ["region_id", nil], ["rgt", "0.25"], ["rgtq", 4]]
2660
+  (1.9ms) RELEASE SAVEPOINT active_record_1
2661
+  (0.6ms) ROLLBACK
2662
+  (0.5ms) BEGIN
2663
+ ---------------------------------------
2664
+ ActsAsNestedIntervalTest: test_preorder
2665
+ ---------------------------------------
2666
+  (0.5ms) SAVEPOINT active_record_1
2667
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2668
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2669
+  (0.8ms) RELEASE SAVEPOINT active_record_1
2670
+  (0.5ms) SAVEPOINT active_record_1
2671
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 430]]
2672
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 430]]
2673
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Oceania"], ["region_id", 430], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2674
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2675
+  (0.6ms) SAVEPOINT active_record_1
2676
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 430]]
2677
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 430]]
2678
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.6"], ["lftp", 3], ["lftq", 5], ["name", "Antarctica"], ["region_id", 430], ["rgt", "0.666666666666667"], ["rgtp", 2], ["rgtq", 3]]
2679
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2680
+  (0.5ms) SAVEPOINT active_record_1
2681
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 431]]
2682
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 431]]
2683
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.75"], ["lftp", 3], ["lftq", 4], ["name", "Australia"], ["region_id", 431], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2684
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2685
+  (0.5ms) SAVEPOINT active_record_1
2686
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 431]]
2687
+ Region Load (1.4ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 431]]
2688
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.714285714285714"], ["lftp", 5], ["lftq", 7], ["name", "New Zealand"], ["region_id", 431], ["rgt", "0.75"], ["rgtp", 3], ["rgtq", 4]]
2689
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2690
+ Region Load (1.9ms) SELECT "regions".* FROM "regions" ORDER BY rgt DESC, lftp ASC
2691
+  (0.7ms) ROLLBACK
2692
+  (0.5ms) BEGIN
2693
+ -----------------------------------------------------------
2694
+ ActsAsNestedIntervalTest: test_rebuild_nested_interval_tree
2695
+ -----------------------------------------------------------
2696
+  (0.5ms) SAVEPOINT active_record_1
2697
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2698
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Europe"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2699
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2700
+  (0.5ms) SAVEPOINT active_record_1
2701
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 435]]
2702
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 435]]
2703
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Romania"], ["region_id", 435], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2704
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2705
+  (0.5ms) SAVEPOINT active_record_1
2706
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2707
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "Asia"], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
2708
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2709
+  (0.6ms) SAVEPOINT active_record_1
2710
+ Region Load (1.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2711
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["name", "America"], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
2712
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2713
+ SQL (1.1ms) UPDATE "regions" SET "lftp" = 0, "lftq" = 0, "rgtp" = 0, "rgtq" = 0, "lft" = 0, "rgt" = 0 WHERE ("regions".lftq > 0)
2714
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" IS NULL ORDER BY "regions"."id" ASC LIMIT 1000
2715
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE ("regions".lftq > 0) AND "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2716
+  (0.5ms) SAVEPOINT active_record_1
2717
+ SQL (1.1ms) UPDATE "regions" SET "lft" = $1, "lftp" = $2, "lftq" = $3, "rgt" = $4, "rgtp" = $5, "rgtq" = $6 WHERE "regions"."id" = 435 [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2718
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2719
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = 435 ORDER BY "regions"."id" ASC LIMIT 1000
2720
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE ("regions".lftq > 0) AND "regions"."id" = $1 LIMIT 1 [["id", 435]]
2721
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 435]]
2722
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE ("regions".lftq > 0) AND "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 435]]
2723
+  (0.6ms) SAVEPOINT active_record_1
2724
+ SQL (2.1ms) UPDATE "regions" SET "lft" = $1, "lftp" = $2, "lftq" = $3, "rgt" = $4, "rgtp" = $5, "rgtq" = $6 WHERE "regions"."id" = 436 [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2725
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2726
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = 436 ORDER BY "regions"."id" ASC LIMIT 1000
2727
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE ("regions".lftq > 0) AND "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2728
+  (0.6ms) SAVEPOINT active_record_1
2729
+ SQL (1.1ms) UPDATE "regions" SET "lft" = $1, "lftp" = $2, "lftq" = $3, "rgt" = $4, "rgtp" = $5, "rgtq" = $6 WHERE "regions"."id" = 437 [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
2730
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2731
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = 437 ORDER BY "regions"."id" ASC LIMIT 1000
2732
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE ("regions".lftq > 0) AND "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2733
+  (0.5ms) SAVEPOINT active_record_1
2734
+ SQL (1.1ms) UPDATE "regions" SET "lft" = $1, "lftp" = $2, "lftq" = $3, "rgt" = $4, "rgtp" = $5, "rgtq" = $6 WHERE "regions"."id" = 438 [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
2735
+  (1.4ms) RELEASE SAVEPOINT active_record_1
2736
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = 438 ORDER BY "regions"."id" ASC LIMIT 1000
2737
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" ORDER BY rgt DESC, lftp ASC
2738
+  (0.6ms) ROLLBACK
2739
+  (0.5ms) BEGIN
2740
+ ---------------------------------------------------------
2741
+ ActsAsNestedIntervalTest: test_root_update_keeps_interval
2742
+ ---------------------------------------------------------
2743
+  (0.6ms) SAVEPOINT active_record_1
2744
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2745
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Europe"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2746
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2747
+  (0.5ms) SAVEPOINT active_record_1
2748
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 439]]
2749
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 439]]
2750
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Romania"], ["region_id", 439], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2751
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2752
+  (0.5ms) SAVEPOINT active_record_1
2753
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2754
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "Asia"], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
2755
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2756
+  (1.2ms) SAVEPOINT active_record_1
2757
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2758
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["name", "America"], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
2759
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2760
+  (0.5ms) SAVEPOINT active_record_1
2761
+ Region Load (4.5ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" IN (442, '---
2762
+ :lock: true
2763
+ ')
2764
+ PG::InvalidTextRepresentation: BŁĄD: nieprawidłowa składnia wejścia dla integer: "---
2765
+ :lock: true
2766
+ "
2767
+ LINE 1: ...egions".* FROM "regions" WHERE "regions"."id" IN (442, '---
2768
+ ^
2769
+ : SELECT "regions".* FROM "regions" WHERE "regions"."id" IN (442, '---
2770
+ :lock: true
2771
+ ')
2772
+  (0.5ms) ROLLBACK TO SAVEPOINT active_record_1
2773
+  (0.7ms) ROLLBACK
2774
+  (0.5ms) BEGIN
2775
+ ------------------------------------
2776
+ ActsAsNestedIntervalTest: test_scope
2777
+ ------------------------------------
2778
+  (0.5ms) SAVEPOINT active_record_1
2779
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2780
+ SQL (1.1ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Earth"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2781
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2782
+  (0.6ms) SAVEPOINT active_record_1
2783
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 443]]
2784
+ Region Load (0.9ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 443]]
2785
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Oceania"], ["region_id", 443], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2786
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2787
+  (0.5ms) SAVEPOINT active_record_1
2788
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 't' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2789
+ SQL (1.0ms) INSERT INTO "regions" ("fiction", "lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["fiction", "t"], ["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Krypton"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2790
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2791
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND (0 = 1 OR lftq = 2 AND lftp = 1 OR lftq = 1 AND lftp = 0)
2792
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 't' AND (lftp > 1 AND lft BETWEEN 0.5 AND 1.0)
2793
+  (0.6ms) ROLLBACK
2794
+  (0.5ms) BEGIN
2795
+ ------------------------------------------------------
2796
+ ActsAsNestedIntervalTest: test_virtual_root_allocation
2797
+ ------------------------------------------------------
2798
+  (0.6ms) SAVEPOINT active_record_1
2799
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2800
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "Europe"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2801
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2802
+  (0.6ms) SAVEPOINT active_record_1
2803
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."id" = $1 LIMIT 1 FOR UPDATE [["id", 446]]
2804
+ Region Load (0.8ms) SELECT "regions".* FROM "regions" WHERE "regions"."region_id" = $1 ORDER BY lftq DESC LIMIT 1 [["region_id", 446]]
2805
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "region_id", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["lft", "0.666666666666667"], ["lftp", 2], ["lftq", 3], ["name", "Romania"], ["region_id", 446], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2806
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2807
+  (0.5ms) SAVEPOINT active_record_1
2808
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2809
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "Asia"], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
2810
+  (0.7ms) RELEASE SAVEPOINT active_record_1
2811
+  (0.6ms) SAVEPOINT active_record_1
2812
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2813
+ SQL (1.0ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["name", "America"], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
2814
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2815
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" ORDER BY rgt DESC, lftp ASC
2816
+  (0.6ms) ROLLBACK
2817
+  (0.5ms) BEGIN
2818
+ -------------------------------------------------
2819
+ ActsAsNestedIntervalTest: test_virtual_root_order
2820
+ -------------------------------------------------
2821
+  (0.6ms) SAVEPOINT active_record_1
2822
+ Region Load (1.1ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2823
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.5"], ["lftp", 1], ["lftq", 2], ["name", "1"], ["rgt", "1.0"], ["rgtp", 1], ["rgtq", 1]]
2824
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2825
+  (0.5ms) SAVEPOINT active_record_1
2826
+ Region Load (1.3ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2827
+ SQL (0.9ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.333333333333333"], ["lftp", 1], ["lftq", 3], ["name", "2"], ["rgt", "0.5"], ["rgtp", 1], ["rgtq", 2]]
2828
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2829
+  (0.5ms) SAVEPOINT active_record_1
2830
+ Region Load (1.2ms) SELECT "regions".* FROM "regions" WHERE "regions"."fiction" = 'f' AND "regions"."region_id" IS NULL ORDER BY lftq DESC LIMIT 1
2831
+ SQL (0.8ms) INSERT INTO "regions" ("lft", "lftp", "lftq", "name", "rgt", "rgtp", "rgtq") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["lft", "0.25"], ["lftp", 1], ["lftq", 4], ["name", "3"], ["rgt", "0.333333333333333"], ["rgtp", 1], ["rgtq", 3]]
2832
+  (0.6ms) RELEASE SAVEPOINT active_record_1
2833
+  (0.6ms) ROLLBACK