protokoll 1.0.3 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d637a366584a1d7151edb84e2be2ee0d4d7431ef
4
- data.tar.gz: b9670f42eb552e422964a3b74e173193648534a7
2
+ SHA256:
3
+ metadata.gz: 7464d8487d2b115287296f811371599a4bfa4446e4a9e73d30f589282d737bad
4
+ data.tar.gz: e4787009b243f6ed2fa8543ae91f629fa38daa1c026216f2aabe3f26664a65b2
5
5
  SHA512:
6
- metadata.gz: 1915150b136264c6187e5a171c7a20702e3a3dbac6ed6112c543fcc8c14f75bef592fe15aca9d7a8576bde78953e518cb92ad38721561ff8d489bfad74a25285
7
- data.tar.gz: e198fc55718542b826176f805f8d619404b1eb3ac87bd7fd8f130697ed6fb65e75878285218c9054c2945f51baa82c7e272cb8b8b5827cce5a8031afe2e6f827
6
+ metadata.gz: 53228acd08a4d8e6939e6e0eb14feadd9c878054c5762080352c50f7d9afef511377aca5d7b90dc8abaeb74b1bdca31454eab41f138b800278e930a4212a0f5e
7
+ data.tar.gz: 01d35c2c25341a1461def0aebe4405ed9de51d0349e64c3f315aaca31b65fc35bb53181ad9afeba621c0104e72f9dcbe546b1fd0d12d21cc548983192c9774b9
data/README.md CHANGED
@@ -81,6 +81,30 @@ end
81
81
  # will produce => "2011HOUSE00001", "2011HOUSE00002"...
82
82
  ```
83
83
 
84
+ It's possible to pass :scope_by option as a simple method, Proc.new or lambda
85
+
86
+ Ex:
87
+ ```ruby
88
+ # :manufacturer should be a Car's instance method(like an ActiveRecord column)
89
+ class Car < ActiveRecord::Base
90
+ protokoll :code, :scope_by => :manufacturer
91
+ end
92
+ # will scope Cars by manufacturers, for example "Ford", "Chevrolet"
93
+
94
+ # :manufacturer and :year should be Car's instance methods(like ActiveRecord columns)
95
+ class Car < ActiveRecord::Base
96
+ protokoll :code, :scope_by => lambda { |o| "#{o.manufacturer}-#{o.year}" }
97
+ end
98
+ # will scope Cars by for example "Ford-2016"
99
+
100
+ # :manufacturer and :year should be Car's instance methods(like ActiveRecord columns)
101
+ class Car < ActiveRecord::Base
102
+ protokoll :code, :scope_by => Proc.new{ "#{manufacturer}-#{model}" }
103
+ end
104
+ # will scope Cars by for example "Ford-Mustang", "Chevrolet-Camaro"
105
+ ```
106
+
107
+
84
108
  ## reserve_number!
85
109
 
86
110
  object.reserve_number!
@@ -116,6 +140,10 @@ Run the generator
116
140
 
117
141
  rails g protokoll:migration
118
142
 
143
+ Optional: If scope_by will be used run next generator as well
144
+
145
+ rails g protokoll:migration:scope_by
146
+
119
147
  and migrate your database
120
148
 
121
149
  rake db:migrate
@@ -0,0 +1,26 @@
1
+ require 'rails/generators'
2
+
3
+ module Protokoll
4
+ module Generators
5
+ module Migration
6
+ class ScopeByGenerator < ::Rails::Generators::Base
7
+
8
+ include Rails::Generators::Migration
9
+
10
+ desc "Generate protokoll's scope_by migration"
11
+ def create_migration_file
12
+ migration_name = "add_scope_by_to_custom_auto_increments.rb"
13
+ migration_template migration_name, File.join('db', 'migrate', migration_name)
14
+ end
15
+
16
+ def self.source_root
17
+ @source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
18
+ end
19
+
20
+ def self.next_migration_number(path)
21
+ Time.now.utc.strftime("%Y%m%d%H%M%S")
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,12 @@
1
+ class AddScopeByToCustomAutoIncrements < ActiveRecord::Migration
2
+ def up
3
+ add_column :custom_auto_increments, :counter_model_scope, :string
4
+ add_index :custom_auto_increments, [:counter_model_name, :counter_model_scope],
5
+ :unique => true, :name => :counter_model_name_scope
6
+ end
7
+
8
+ def down
9
+ remove_index :custom_auto_increments, name: :counter_model_name_scope
10
+ remove_column :custom_auto_increments, :counter_model_scope, :string
11
+ end
12
+ end
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_record'
2
4
 
3
5
  module Protokoll
4
6
  class Counter
5
7
  def self.next(object, options)
6
- element = Models::CustomAutoIncrement.find_or_create_by(counter_model_name: object.class.to_s.underscore)
8
+ element = Models::CustomAutoIncrement.find_or_create_by(build_attrs(object, options))
7
9
 
8
10
  element.counter = options[:start] if outdated?(element, options) || element.counter == 0
9
11
  element.counter += 1
@@ -18,19 +20,33 @@ module Protokoll
18
20
 
19
21
  private
20
22
 
23
+ def self.build_attrs(object, options)
24
+ attrs = {counter_model_name: object.model_name.name.underscore}
25
+ return attrs unless options[:scope_by]
26
+
27
+ scope_by = options[:scope_by].respond_to?(:call) ?
28
+ object.instance_eval(&options[:scope_by]) :
29
+ object.send(options[:scope_by])
30
+
31
+ attrs.merge(counter_model_scope: scope_by)
32
+ end
33
+
21
34
  def self.outdated?(record, options)
22
- Time.now.utc.strftime(update_event(options)).to_i > record.updated_at.strftime(update_event(options)).to_i
35
+ event = update_event(options)
36
+ return false if event.empty?
37
+
38
+ Time.now.utc.strftime(event).to_i > record.updated_at.strftime(event).to_i
23
39
  end
24
40
 
25
41
  def self.update_event(options)
26
42
  pattern = options[:pattern]
27
43
  event = String.new
28
44
 
29
- event += "%Y" if pattern.include? "%y" or pattern.include? "%Y"
30
- event += "%m" if pattern.include? "%m"
31
- event += "%H" if pattern.include? "%H"
32
- event += "%M" if pattern.include? "%M"
33
- event += "%d" if pattern.include? "%d"
45
+ event << "%Y" if pattern.include? "%y" or pattern.include? "%Y"
46
+ event << "%m" if pattern.include? "%m"
47
+ event << "%H" if pattern.include? "%H"
48
+ event << "%M" if pattern.include? "%M"
49
+ event << "%d" if pattern.include? "%d"
34
50
  event
35
51
  end
36
52
  end
@@ -1,32 +1,33 @@
1
+ # frozen_string_literal: true
1
2
 
2
3
  module Protokoll
3
4
  class Formater
4
5
  def format(number, options)
5
6
  @options = options
6
-
7
+
7
8
  build(number)
8
9
  end
9
-
10
- private
11
-
10
+
11
+ private
12
+
12
13
  # gets the next number.
13
14
  # it prepends the prefix + counter + sufix
14
15
  # ex:
15
- # "%Y####BANK"
16
+ # "%Y####BANK"
16
17
  # %Y => prefix (year)
17
18
  # #### => counter (starts with 0001)
18
19
  # BANK => sufix
19
- #
20
+ #
20
21
  # if we are in 2011, the first model to be saved will get "20110001BANK"
21
22
  # the next model to be saved will get "20110002BANK", "20110003BANK"...
22
23
  #
23
24
  # number => is the counter
24
- #
25
- # next_custom_number(1)
25
+ #
26
+ # next_custom_number(1)
26
27
  # => "20110001BANK"
27
28
  def build(number)
28
- prefix(@options[:pattern]).to_s +
29
- counter(@options[:pattern], number).to_s +
29
+ prefix(@options[:pattern]).to_s +
30
+ counter(@options[:pattern], number).to_s +
30
31
  sufix(@options[:pattern]).to_s
31
32
  end
32
33
 
@@ -61,12 +62,13 @@ module Protokoll
61
62
  end
62
63
 
63
64
  def expand_times(pattern)
64
- pattern.sub!("%y", Time.now.strftime("%y"))
65
- pattern.sub!("%Y", Time.now.strftime("%Y"))
66
- pattern.sub!("%d", Time.now.strftime("%d"))
67
- pattern.sub!("%m", Time.now.strftime("%m"))
68
- pattern.sub!("%M", Time.now.strftime("%M"))
69
- pattern.sub("%H", Time.now.strftime("%H"))
65
+ pat = pattern.dup # pattern is a frozen string.
66
+ pat.sub!("%y", Time.now.strftime("%y"))
67
+ pat.sub!("%Y", Time.now.strftime("%Y"))
68
+ pat.sub!("%d", Time.now.strftime("%d"))
69
+ pat.sub!("%m", Time.now.strftime("%m"))
70
+ pat.sub!("%M", Time.now.strftime("%M"))
71
+ pat.sub("%H", Time.now.strftime("%H"))
70
72
  end
71
73
 
72
74
  def digits_size(pattern)
@@ -75,5 +77,5 @@ module Protokoll
75
77
  end
76
78
 
77
79
 
78
- end
80
+ end
79
81
  end
@@ -14,7 +14,8 @@ module Protokoll
14
14
  options = { :pattern => "%Y%m#####",
15
15
  :number_symbol => "#",
16
16
  :column => column,
17
- :start => 0 }
17
+ :start => 0,
18
+ :scope_by => nil }
18
19
 
19
20
  options.merge!(_options)
20
21
  raise ArgumentError.new("pattern can't be nil!") if options[:pattern].nil?
@@ -1,3 +1,3 @@
1
1
  module Protokoll
2
- VERSION = "1.0.3"
2
+ VERSION = "2.0.2"
3
3
  end
@@ -0,0 +1,3 @@
1
+ //= link_tree ../images
2
+ //= link_directory ../javascripts .js
3
+ //= link_directory ../stylesheets .css
@@ -34,12 +34,6 @@ module Dummy
34
34
 
35
35
  # Configure sensitive parameters which will be filtered from the log file.
36
36
  config.filter_parameters += [:password]
37
-
38
- # Enable the asset pipeline
39
- config.assets.enabled = true
40
-
41
- # Version of your assets, change this if you want to expire all your assets
42
- config.assets.version = '1.0'
43
37
  end
44
38
  end
45
39
 
@@ -19,11 +19,5 @@ Dummy::Application.configure do
19
19
  # Only use best-standards-support built into browsers
20
20
  config.action_dispatch.best_standards_support = :builtin
21
21
 
22
- # Do not compress assets
23
- config.assets.compress = false
24
-
25
- # Expands the lines which load the assets
26
- config.assets.debug = true
27
-
28
22
  config.eager_load = false
29
23
  end
@@ -8,21 +8,6 @@ Dummy::Application.configure do
8
8
  config.consider_all_requests_local = false
9
9
  config.action_controller.perform_caching = true
10
10
 
11
- # Disable Rails's static asset server (Apache or nginx will already do this)
12
- config.serve_static_assets = false
13
-
14
- # Compress JavaScripts and CSS
15
- config.assets.compress = true
16
-
17
- # Don't fallback to assets pipeline if a precompiled asset is missed
18
- config.assets.compile = false
19
-
20
- # Generate digests for assets URLs
21
- config.assets.digest = true
22
-
23
- # Defaults to Rails.root.join("public/assets")
24
- # config.assets.manifest = YOUR_PATH
25
-
26
11
  # Specifies the header that your server uses for sending files
27
12
  # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
13
  # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
@@ -34,9 +34,6 @@ Dummy::Application.configure do
34
34
  # Print deprecation notices to the stderr
35
35
  config.active_support.deprecation = :stderr
36
36
 
37
- # Allow pass debug_assets=true as a query parameter to load pages with unpackaged assets
38
- config.assets.allow_debugging = true
39
-
40
37
  config.eager_load = false
41
38
 
42
39
  config.active_support.test_order = :random
Binary file
@@ -1,7 +1,9 @@
1
- class CreateProtocols < ActiveRecord::Migration
1
+ class CreateProtocols < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :protocols do |t|
4
4
  t.string :number
5
+ t.string :context
6
+ t.string :context_2
5
7
 
6
8
  t.timestamps
7
9
  end
@@ -1,4 +1,4 @@
1
- class CreateCalls < ActiveRecord::Migration
1
+ class CreateCalls < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :calls do |t|
4
4
  t.string :number
@@ -1,7 +1,7 @@
1
- class CreateCustomAutoIncrements < ActiveRecord::Migration
1
+ class CreateCustomAutoIncrements < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  create_table :custom_auto_increments, :force => true do |t|
4
- t.string :counter_model_name
4
+ t.string :counter_model_name
5
5
  t.integer :counter, :default => 0
6
6
  t.timestamps
7
7
  end
@@ -0,0 +1,12 @@
1
+ class AddScopeByToCustomAutoIncrements < ActiveRecord::Migration[4.2]
2
+ def up
3
+ add_column :custom_auto_increments, :counter_model_scope, :string
4
+ add_index :custom_auto_increments, [:counter_model_name, :counter_model_scope],
5
+ :unique => true, :name => :counter_model_name_scope
6
+ end
7
+
8
+ def down
9
+ remove_index :custom_auto_increments, name: :counter_model_name_scope
10
+ remove_column :custom_auto_increments, :counter_model_scope, :string
11
+ end
12
+ end
@@ -1,37 +1,38 @@
1
- # encoding: UTF-8
2
1
  # This file is auto-generated from the current state of the database. Instead
3
2
  # of editing this file, please use the migrations feature of Active Record to
4
3
  # incrementally modify your database, and then regenerate this schema definition.
5
4
  #
6
- # Note that this schema.rb definition is the authoritative source for your
7
- # database schema. If you need to create the application database on another
8
- # system, you should be using db:schema:load, not running all the migrations
9
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
- # you'll amass, the slower it'll run and the greater likelihood for issues).
5
+ # This file is the source Rails uses to define your schema when running `bin/rails
6
+ # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
+ # be faster and is potentially less error prone than running all of your
8
+ # migrations from scratch. Old migrations may fail to apply correctly if those
9
+ # migrations use external dependencies or application code.
11
10
  #
12
11
  # It's strongly recommended that you check this file into your version control system.
13
12
 
14
- ActiveRecord::Schema.define(version: 20120222164124) do
15
-
13
+ ActiveRecord::Schema[7.0].define(version: 2016_03_10_030821) do
16
14
  create_table "calls", force: :cascade do |t|
17
- t.string "number"
18
- t.datetime "created_at"
19
- t.datetime "updated_at"
15
+ t.string "number"
16
+ t.datetime "created_at", precision: nil
17
+ t.datetime "updated_at", precision: nil
20
18
  end
21
19
 
22
20
  create_table "custom_auto_increments", force: :cascade do |t|
23
- t.string "counter_model_name"
24
- t.integer "counter", default: 0
25
- t.datetime "created_at"
26
- t.datetime "updated_at"
21
+ t.string "counter_model_name"
22
+ t.integer "counter", default: 0
23
+ t.datetime "created_at", precision: nil
24
+ t.datetime "updated_at", precision: nil
25
+ t.string "counter_model_scope"
26
+ t.index ["counter_model_name", "counter_model_scope"], name: "counter_model_name_scope", unique: true
27
+ t.index ["counter_model_name"], name: "index_custom_auto_increments_on_counter_model_name"
27
28
  end
28
29
 
29
- add_index "custom_auto_increments", ["counter_model_name"], name: "index_custom_auto_increments_on_counter_model_name"
30
-
31
30
  create_table "protocols", force: :cascade do |t|
32
- t.string "number"
33
- t.datetime "created_at"
34
- t.datetime "updated_at"
31
+ t.string "number"
32
+ t.string "context"
33
+ t.string "context_2"
34
+ t.datetime "created_at", precision: nil
35
+ t.datetime "updated_at", precision: nil
35
36
  end
36
37
 
37
38
  end
Binary file
@@ -1,43 +1,88 @@
1
-  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2
-  (0.4ms) select sqlite_version(*)
3
-  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
- ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
1
+ DEPRECATION WARNING: Using legacy connection handling is deprecated. Please set
2
+ `legacy_connection_handling` to `false` in your application.
3
+
4
+ The new connection handling does not support `connection_handlers`
5
+ getter and setter.
6
+
7
+ Read more about how to migrate at: https://guides.rubyonrails.org/active_record_multiple_databases.html#migrate-to-the-new-connection-handling
8
+ (called from <top (required)> at /Users/celsodantas/src/github.com/protokoll/test/dummy/config/environment.rb:5)
9
+  (0.5ms) SELECT sqlite_version(*)
10
+  (0.6ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)
11
+  (0.5ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL)
12
+ ActiveRecord::SchemaMigration Pluck (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
5
13
  Migrating to CreateProtocols (20110923024431)
6
-  (0.1ms) begin transaction
7
- DEPRECATION WARNING: `#timestamps` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/celsodantas/Code/ruby/protokoll/test/dummy/db/migrate/20110923024431_create_protocols.rb:6)
8
-  (0.4ms) CREATE TABLE "protocols" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "number" varchar, "created_at" datetime, "updated_at" datetime)
9
- SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20110923024431"]]
10
-  (0.8ms) commit transaction
14
+ TRANSACTION (0.0ms) begin transaction
15
+  (0.2ms) CREATE TABLE "protocols" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "number" varchar, "context" varchar, "context_2" varchar, "created_at" datetime, "updated_at" datetime)
16
+ ActiveRecord::SchemaMigration Create (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20110923024431"]]
17
+ TRANSACTION (0.5ms) commit transaction
11
18
  Migrating to CreateCalls (20110928013630)
12
-  (0.1ms) begin transaction
13
- DEPRECATION WARNING: `#timestamps` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/celsodantas/Code/ruby/protokoll/test/dummy/db/migrate/20110928013630_create_calls.rb:5)
14
-  (0.2ms) CREATE TABLE "calls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "number" varchar, "created_at" datetime, "updated_at" datetime)
15
- SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20110928013630"]]
16
-  (0.7ms) commit transaction
19
+ TRANSACTION (0.0ms) begin transaction
20
+  (0.2ms) CREATE TABLE "calls" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "number" varchar, "created_at" datetime, "updated_at" datetime)
21
+ ActiveRecord::SchemaMigration Create (0.0ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20110928013630"]]
22
+ TRANSACTION (0.4ms) commit transaction
17
23
  Migrating to CreateCustomAutoIncrements (20120222164124)
18
-  (0.0ms) begin transaction
19
- DEPRECATION WARNING: `#timestamps` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in up at /Users/celsodantas/Code/ruby/protokoll/test/dummy/db/migrate/20120222164124_create_custom_auto_increments.rb:6)
20
-  (0.2ms) CREATE TABLE "custom_auto_increments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "counter_model_name" varchar, "counter" integer DEFAULT 0, "created_at" datetime, "updated_at" datetime)
21
-  (0.1ms) CREATE INDEX "index_custom_auto_increments_on_counter_model_name" ON "custom_auto_increments" ("counter_model_name")
22
- SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20120222164124"]]
23
-  (0.6ms) commit transaction
24
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
25
-  (0.1ms)  SELECT sql
26
- FROM sqlite_master
27
- WHERE name='index_custom_auto_increments_on_counter_model_name' AND type='index'
28
- UNION ALL
29
- SELECT sql
30
- FROM sqlite_temp_master
31
- WHERE name='index_custom_auto_increments_on_counter_model_name' AND type='index'
24
+ TRANSACTION (0.0ms) begin transaction
25
+  (0.0ms) DROP TABLE IF EXISTS "custom_auto_increments"
26
+  (0.2ms) CREATE TABLE "custom_auto_increments" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "counter_model_name" varchar, "counter" integer DEFAULT 0, "created_at" datetime, "updated_at" datetime)
27
+  (0.0ms) CREATE INDEX "index_custom_auto_increments_on_counter_model_name" ON "custom_auto_increments" ("counter_model_name")
28
+ ActiveRecord::SchemaMigration Create (0.0ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20120222164124"]]
29
+ TRANSACTION (0.4ms) commit transaction
30
+ Migrating to AddScopeByToCustomAutoIncrements (20160310030821)
31
+ TRANSACTION (0.0ms) begin transaction
32
+  (0.2ms) ALTER TABLE "custom_auto_increments" ADD "counter_model_scope" varchar
33
+  (0.0ms) CREATE UNIQUE INDEX "counter_model_name_scope" ON "custom_auto_increments" ("counter_model_name", "counter_model_scope")
34
+ ActiveRecord::SchemaMigration Create (0.0ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160310030821"]]
35
+ TRANSACTION (0.5ms) commit transaction
36
+ ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]]
37
+ TRANSACTION (0.0ms) begin transaction
38
+ ActiveRecord::InternalMetadata Create (0.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "development"], ["created_at", "2022-03-25 13:10:51.386338"], ["updated_at", "2022-03-25 13:10:51.386338"]]
39
+ TRANSACTION (0.4ms) commit transaction
40
+  (0.0ms) SELECT sqlite_version(*)
41
+ ActiveRecord::SchemaMigration Pluck (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
42
+ DEPRECATION WARNING: Using legacy connection handling is deprecated. Please set
43
+ `legacy_connection_handling` to `false` in your application.
44
+
45
+ The new connection handling does not support `connection_handlers`
46
+ getter and setter.
47
+
48
+ Read more about how to migrate at: https://guides.rubyonrails.org/active_record_multiple_databases.html#migrate-to-the-new-connection-handling
49
+ (called from <top (required)> at /Users/celsodantas/src/github.com/protokoll/test/dummy/config/environment.rb:5)
50
+  (0.4ms) SELECT sqlite_version(*)
51
+ ActiveRecord::SchemaMigration Pluck (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
52
+ ActiveRecord::InternalMetadata Pluck (0.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]]
53
+ ActiveRecord::SchemaMigration Pluck (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
54
+ ActiveRecord::InternalMetadata Pluck (0.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]]
55
+ ActiveRecord::SchemaMigration Pluck (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
56
+ ActiveRecord::InternalMetadata Pluck (0.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]]
57
+  (0.0ms) SELECT sqlite_version(*)
58
+  (0.0ms) SELECT sqlite_version(*)
59
+  (0.0ms) DROP TABLE IF EXISTS "calls"
60
+  (0.6ms) CREATE TABLE "calls" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "number" varchar, "created_at" datetime, "updated_at" datetime)
61
+  (0.0ms) DROP TABLE IF EXISTS "custom_auto_increments"
62
+  (0.5ms) CREATE TABLE "custom_auto_increments" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "counter_model_name" varchar, "counter" integer DEFAULT 0, "created_at" datetime, "updated_at" datetime, "counter_model_scope" varchar)
63
+  (0.4ms) CREATE UNIQUE INDEX "counter_model_name_scope" ON "custom_auto_increments" ("counter_model_name", "counter_model_scope")
64
+  (0.4ms) CREATE INDEX "index_custom_auto_increments_on_counter_model_name" ON "custom_auto_increments" ("counter_model_name")
65
+  (0.0ms) DROP TABLE IF EXISTS "protocols"
66
+  (0.4ms) CREATE TABLE "protocols" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "number" varchar, "context" varchar, "context_2" varchar, "created_at" datetime, "updated_at" datetime)
67
+  (0.4ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)
68
+ ActiveRecord::SchemaMigration Pluck (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
69
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES (20160310030821)
70
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES
71
+ (20110923024431),
72
+ (20110928013630),
73
+ (20120222164124);
74
+
32
75
  
33
-  (1.2ms) CREATE TABLE "calls" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "number" varchar, "created_at" datetime, "updated_at" datetime) 
34
-  (1.1ms) CREATE TABLE "custom_auto_increments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "counter_model_name" varchar, "counter" integer DEFAULT 0, "created_at" datetime, "updated_at" datetime)
35
-  (0.1ms) select sqlite_version(*)
36
-  (1.0ms) CREATE INDEX "index_custom_auto_increments_on_counter_model_name" ON "custom_auto_increments" ("counter_model_name")
37
-  (0.9ms) CREATE TABLE "protocols" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "number" varchar, "created_at" datetime, "updated_at" datetime) 
38
-  (0.8ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
39
-  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
40
-  (0.1ms) SELECT version FROM "schema_migrations"
41
-  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20120222164124')
42
-  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20110923024431')
43
-  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20110928013630')
76
+  (0.4ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL)
77
+ ActiveRecord::InternalMetadata Load (0.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]]
78
+ TRANSACTION (0.0ms) begin transaction
79
+ ActiveRecord::InternalMetadata Create (0.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "development"], ["created_at", "2022-03-25 13:10:52.110452"], ["updated_at", "2022-03-25 13:10:52.110452"]]
80
+ TRANSACTION (0.4ms) commit transaction
81
+ ActiveRecord::InternalMetadata Load (0.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]]
82
+ TRANSACTION (0.0ms) begin transaction
83
+ ActiveRecord::InternalMetadata Update (0.1ms) UPDATE "ar_internal_metadata" SET "value" = ?, "updated_at" = ? WHERE "ar_internal_metadata"."key" = ? [["value", "test"], ["updated_at", "2022-03-25 13:10:52.111594"], ["key", "environment"]]
84
+ TRANSACTION (0.5ms) commit transaction
85
+ ActiveRecord::InternalMetadata Load (0.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "schema_sha1"], ["LIMIT", 1]]
86
+ TRANSACTION (0.0ms) begin transaction
87
+ ActiveRecord::InternalMetadata Create (0.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "schema_sha1"], ["value", "548cf97f582536c097c1a7c1626a51c80e0a4672"], ["created_at", "2022-03-25 13:10:52.112706"], ["updated_at", "2022-03-25 13:10:52.112706"]]
88
+ TRANSACTION (0.3ms) commit transaction