buoys 1.0.0 → 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 +5 -5
- data/README.md +1 -1
- data/Rakefile +2 -0
- data/lib/buoys/buoy.rb +2 -2
- data/lib/buoys/helper.rb +1 -1
- data/lib/buoys/loader.rb +1 -1
- data/lib/buoys/version.rb +1 -1
- data/lib/generators/buoys/install_generator.rb +1 -1
- data/lib/generators/buoys/templates/_buoys.html.erb +1 -1
- data/lib/generators/buoys/templates/breadcrumbs.rb +1 -1
- data/test/buoys_buoy_test.rb +17 -1
- data/test/buoys_generator_test.rb +1 -0
- data/test/dummy/Rakefile +1 -1
- data/test/dummy/app/assets/config/manifest.js +3 -0
- data/test/dummy/app/assets/javascripts/application.js +3 -1
- data/test/dummy/app/assets/javascripts/cable.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +3 -3
- data/test/dummy/app/channels/application_cable/channel.rb +4 -0
- data/test/dummy/app/channels/application_cable/connection.rb +4 -0
- data/test/dummy/app/controllers/application_controller.rb +0 -5
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/jobs/application_job.rb +2 -0
- data/test/dummy/app/mailers/application_mailer.rb +4 -0
- data/test/dummy/app/models/application_record.rb +3 -0
- data/test/dummy/app/models/item.rb +1 -1
- data/test/dummy/app/models/user.rb +1 -1
- data/test/dummy/app/views/layouts/application.html.erb +10 -9
- data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/test/dummy/bin/bundle +1 -1
- data/test/dummy/bin/rails +1 -1
- data/test/dummy/bin/setup +20 -13
- data/test/dummy/bin/update +31 -0
- data/test/dummy/bin/yarn +11 -0
- data/test/dummy/config/application.rb +9 -21
- data/test/dummy/config/boot.rb +2 -4
- data/test/dummy/config/cable.yml +10 -0
- data/test/dummy/config/database.yml +1 -1
- data/test/dummy/config/environment.rb +1 -3
- data/test/dummy/config/environments/development.rb +31 -13
- data/test/dummy/config/environments/production.rb +31 -18
- data/test/dummy/config/environments/test.rb +10 -13
- data/test/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/test/dummy/config/initializers/assets.rb +6 -5
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -2
- data/test/dummy/config/initializers/content_security_policy.rb +25 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +2 -2
- data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -2
- data/test/dummy/config/initializers/inflections.rb +0 -2
- data/test/dummy/config/initializers/mime_types.rb +0 -2
- data/test/dummy/config/initializers/wrap_parameters.rb +2 -4
- data/test/dummy/config/locales/en.yml +10 -0
- data/test/dummy/config/puma.rb +37 -0
- data/test/dummy/config/routes.rb +2 -2
- data/test/dummy/config/spring.rb +6 -0
- data/test/dummy/config/storage.yml +34 -0
- data/test/dummy/config.ru +2 -1
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +105 -0
- data/test/dummy/log/test.log +396 -267
- data/test/dummy/package.json +5 -0
- data/test/dummy/public/404.html +6 -6
- data/test/dummy/public/422.html +6 -6
- data/test/dummy/public/500.html +6 -6
- data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/test/dummy/public/apple-touch-icon.png +0 -0
- data/test/dummy/tmp/development_secret.txt +1 -0
- data/test/test_helper.rb +6 -7
- metadata +87 -53
- data/test/dummy/README.rdoc +0 -28
- data/test/dummy/config/initializers/session_store.rb +0 -5
- data/test/dummy/config/secrets.yml +0 -22
@@ -1,5 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
Rails.application.configure do
|
4
2
|
# Settings specified here will take precedence over those in config/application.rb.
|
5
3
|
|
@@ -16,15 +14,13 @@ Rails.application.configure do
|
|
16
14
|
config.consider_all_requests_local = false
|
17
15
|
config.action_controller.perform_caching = true
|
18
16
|
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
# NGINX, varnish or squid.
|
23
|
-
# config.action_dispatch.rack_cache = true
|
17
|
+
# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
|
18
|
+
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
|
19
|
+
# config.require_master_key = true
|
24
20
|
|
25
21
|
# Disable serving static files from the `/public` folder by default since
|
26
22
|
# Apache or NGINX already handles this.
|
27
|
-
config.
|
23
|
+
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
28
24
|
|
29
25
|
# Compress JavaScripts and CSS.
|
30
26
|
config.assets.js_compressor = :uglifier
|
@@ -33,16 +29,23 @@ Rails.application.configure do
|
|
33
29
|
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
34
30
|
config.assets.compile = false
|
35
31
|
|
36
|
-
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
37
|
-
# yet still be able to expire them through the digest params.
|
38
|
-
config.assets.digest = true
|
39
|
-
|
40
32
|
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
41
33
|
|
34
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
35
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
36
|
+
|
42
37
|
# Specifies the header that your server uses for sending files.
|
43
38
|
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
44
39
|
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
45
40
|
|
41
|
+
# Store uploaded files on the local file system (see config/storage.yml for options)
|
42
|
+
config.active_storage.service = :local
|
43
|
+
|
44
|
+
# Mount Action Cable outside main process or domain
|
45
|
+
# config.action_cable.mount_path = nil
|
46
|
+
# config.action_cable.url = 'wss://example.com/cable'
|
47
|
+
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
|
48
|
+
|
46
49
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
47
50
|
# config.force_ssl = true
|
48
51
|
|
@@ -51,16 +54,16 @@ Rails.application.configure do
|
|
51
54
|
config.log_level = :debug
|
52
55
|
|
53
56
|
# Prepend all log lines with the following tags.
|
54
|
-
|
55
|
-
|
56
|
-
# Use a different logger for distributed setups.
|
57
|
-
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
57
|
+
config.log_tags = [ :request_id ]
|
58
58
|
|
59
59
|
# Use a different cache store in production.
|
60
60
|
# config.cache_store = :mem_cache_store
|
61
61
|
|
62
|
-
#
|
63
|
-
# config.
|
62
|
+
# Use a real queuing backend for Active Job (and separate queues per environment)
|
63
|
+
# config.active_job.queue_adapter = :resque
|
64
|
+
# config.active_job.queue_name_prefix = "dummy_#{Rails.env}"
|
65
|
+
|
66
|
+
config.action_mailer.perform_caching = false
|
64
67
|
|
65
68
|
# Ignore bad email addresses and do not raise email delivery errors.
|
66
69
|
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
@@ -76,6 +79,16 @@ Rails.application.configure do
|
|
76
79
|
# Use default logging formatter so that PID and timestamp are not suppressed.
|
77
80
|
config.log_formatter = ::Logger::Formatter.new
|
78
81
|
|
82
|
+
# Use a different logger for distributed setups.
|
83
|
+
# require 'syslog/logger'
|
84
|
+
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
85
|
+
|
86
|
+
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
87
|
+
logger = ActiveSupport::Logger.new(STDOUT)
|
88
|
+
logger.formatter = config.log_formatter
|
89
|
+
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
90
|
+
end
|
91
|
+
|
79
92
|
# Do not dump schema after migrations.
|
80
93
|
config.active_record.dump_schema_after_migration = false
|
81
94
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
Rails.application.configure do
|
4
2
|
# Settings specified here will take precedence over those in config/application.rb.
|
5
3
|
|
@@ -14,14 +12,11 @@ Rails.application.configure do
|
|
14
12
|
# preloads Rails for running tests, you may have to set it to true.
|
15
13
|
config.eager_load = false
|
16
14
|
|
17
|
-
# Configure
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
config.serve_static_files = true
|
23
|
-
config.static_cache_control = 'public, max-age=3600'
|
24
|
-
end
|
15
|
+
# Configure public file server for tests with Cache-Control for performance.
|
16
|
+
config.public_file_server.enabled = true
|
17
|
+
config.public_file_server.headers = {
|
18
|
+
'Cache-Control' => "public, max-age=#{1.hour.to_i}"
|
19
|
+
}
|
25
20
|
|
26
21
|
# Show full error reports and disable caching.
|
27
22
|
config.consider_all_requests_local = true
|
@@ -33,14 +28,16 @@ Rails.application.configure do
|
|
33
28
|
# Disable request forgery protection in test environment.
|
34
29
|
config.action_controller.allow_forgery_protection = false
|
35
30
|
|
31
|
+
# Store uploaded files on the local file system in a temporary directory
|
32
|
+
config.active_storage.service = :test
|
33
|
+
|
34
|
+
config.action_mailer.perform_caching = false
|
35
|
+
|
36
36
|
# Tell Action Mailer not to deliver emails to the real world.
|
37
37
|
# The :test delivery method accumulates sent emails in the
|
38
38
|
# ActionMailer::Base.deliveries array.
|
39
39
|
config.action_mailer.delivery_method = :test
|
40
40
|
|
41
|
-
# Randomize the order test cases are executed.
|
42
|
-
config.active_support.test_order = :random
|
43
|
-
|
44
41
|
# Print deprecation notices to the stderr.
|
45
42
|
config.active_support.deprecation = :stderr
|
46
43
|
|
@@ -1,13 +1,14 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
# Be sure to restart your server when you modify this file.
|
4
2
|
|
5
3
|
# Version of your assets, change this if you want to expire all your assets.
|
6
4
|
Rails.application.config.assets.version = '1.0'
|
7
5
|
|
8
|
-
# Add additional assets to the asset load path
|
6
|
+
# Add additional assets to the asset load path.
|
9
7
|
# Rails.application.config.assets.paths << Emoji.images_path
|
8
|
+
# Add Yarn node_modules folder to the asset load path.
|
9
|
+
Rails.application.config.assets.paths << Rails.root.join('node_modules')
|
10
10
|
|
11
11
|
# Precompile additional assets.
|
12
|
-
# application.js, application.css, and all non-JS/CSS in app/assets
|
13
|
-
#
|
12
|
+
# application.js, application.css, and all non-JS/CSS in the app/assets
|
13
|
+
# folder are already added.
|
14
|
+
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Define an application-wide content security policy
|
4
|
+
# For further information see the following documentation
|
5
|
+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
|
6
|
+
|
7
|
+
# Rails.application.config.content_security_policy do |policy|
|
8
|
+
# policy.default_src :self, :https
|
9
|
+
# policy.font_src :self, :https, :data
|
10
|
+
# policy.img_src :self, :https, :data
|
11
|
+
# policy.object_src :none
|
12
|
+
# policy.script_src :self, :https
|
13
|
+
# policy.style_src :self, :https
|
14
|
+
|
15
|
+
# # Specify URI for violation reports
|
16
|
+
# # policy.report_uri "/csp-violation-report-endpoint"
|
17
|
+
# end
|
18
|
+
|
19
|
+
# If you are using UJS then enable automatic nonce generation
|
20
|
+
# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
|
21
|
+
|
22
|
+
# Report CSP violations to a specified URI
|
23
|
+
# For further information see the following documentation:
|
24
|
+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
|
25
|
+
# Rails.application.config.content_security_policy_report_only = true
|
@@ -1,5 +1,5 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
# Be sure to restart your server when you modify this file.
|
4
2
|
|
3
|
+
# Specify a serializer for the signed and encrypted cookie jars.
|
4
|
+
# Valid options are :json, :marshal, and :hybrid.
|
5
5
|
Rails.application.config.action_dispatch.cookies_serializer = :json
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
# Be sure to restart your server when you modify this file.
|
4
2
|
|
5
3
|
# This file contains settings for ActionController::ParamsWrapper which
|
@@ -7,10 +5,10 @@
|
|
7
5
|
|
8
6
|
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
9
7
|
ActiveSupport.on_load(:action_controller) do
|
10
|
-
wrap_parameters format: [:json]
|
8
|
+
wrap_parameters format: [:json]
|
11
9
|
end
|
12
10
|
|
13
11
|
# To enable root element in JSON for ActiveRecord objects.
|
14
12
|
# ActiveSupport.on_load(:active_record) do
|
15
|
-
#
|
13
|
+
# self.include_root_in_json = true
|
16
14
|
# end
|
@@ -16,6 +16,16 @@
|
|
16
16
|
#
|
17
17
|
# This would use the information in config/locales/es.yml.
|
18
18
|
#
|
19
|
+
# The following keys must be escaped otherwise they will not be retrieved by
|
20
|
+
# the default I18n backend:
|
21
|
+
#
|
22
|
+
# true, false, on, off, yes, no
|
23
|
+
#
|
24
|
+
# Instead, surround them with single quotes.
|
25
|
+
#
|
26
|
+
# en:
|
27
|
+
# 'true': 'foo'
|
28
|
+
#
|
19
29
|
# To learn more, please read the Rails Internationalization guide
|
20
30
|
# available at http://guides.rubyonrails.org/i18n.html.
|
21
31
|
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# Puma can serve each request in a thread from an internal thread pool.
|
2
|
+
# The `threads` method setting takes two numbers: a minimum and maximum.
|
3
|
+
# Any libraries that use thread pools should be configured to match
|
4
|
+
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
5
|
+
# and maximum; this matches the default thread size of Active Record.
|
6
|
+
#
|
7
|
+
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
|
8
|
+
threads threads_count, threads_count
|
9
|
+
|
10
|
+
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
|
11
|
+
#
|
12
|
+
port ENV.fetch("PORT") { 3000 }
|
13
|
+
|
14
|
+
# Specifies the `environment` that Puma will run in.
|
15
|
+
#
|
16
|
+
environment ENV.fetch("RAILS_ENV") { "development" }
|
17
|
+
|
18
|
+
# Specifies the `pidfile` that Puma will use.
|
19
|
+
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
|
20
|
+
|
21
|
+
# Specifies the number of `workers` to boot in clustered mode.
|
22
|
+
# Workers are forked webserver processes. If using threads and workers together
|
23
|
+
# the concurrency of the application would be max `threads` * `workers`.
|
24
|
+
# Workers do not work on JRuby or Windows (both of which do not support
|
25
|
+
# processes).
|
26
|
+
#
|
27
|
+
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
|
28
|
+
|
29
|
+
# Use the `preload_app!` method when specifying a `workers` number.
|
30
|
+
# This directive tells Puma to first boot the application and load code
|
31
|
+
# before forking the application. This takes advantage of Copy On Write
|
32
|
+
# process behavior so workers use less memory.
|
33
|
+
#
|
34
|
+
# preload_app!
|
35
|
+
|
36
|
+
# Allow puma to be restarted by `rails restart` command.
|
37
|
+
plugin :tmp_restart
|
data/test/dummy/config/routes.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
Rails.application.routes.draw do
|
2
|
+
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
|
3
|
+
|
4
4
|
get 'about' => 'dummy#dummy', as: :about
|
5
5
|
get 'about/history' => 'dummy#dummy', as: :history
|
6
6
|
|
@@ -0,0 +1,34 @@
|
|
1
|
+
test:
|
2
|
+
service: Disk
|
3
|
+
root: <%= Rails.root.join("tmp/storage") %>
|
4
|
+
|
5
|
+
local:
|
6
|
+
service: Disk
|
7
|
+
root: <%= Rails.root.join("storage") %>
|
8
|
+
|
9
|
+
# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
|
10
|
+
# amazon:
|
11
|
+
# service: S3
|
12
|
+
# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
|
13
|
+
# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
|
14
|
+
# region: us-east-1
|
15
|
+
# bucket: your_own_bucket
|
16
|
+
|
17
|
+
# Remember not to checkin your GCS keyfile to a repository
|
18
|
+
# google:
|
19
|
+
# service: GCS
|
20
|
+
# project: your_project
|
21
|
+
# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
|
22
|
+
# bucket: your_own_bucket
|
23
|
+
|
24
|
+
# Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
|
25
|
+
# microsoft:
|
26
|
+
# service: AzureStorage
|
27
|
+
# storage_account_name: your_account_name
|
28
|
+
# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
|
29
|
+
# container: your_container_name
|
30
|
+
|
31
|
+
# mirror:
|
32
|
+
# service: Mirror
|
33
|
+
# primary: local
|
34
|
+
# mirrors: [ amazon, google, microsoft ]
|
data/test/dummy/config.ru
CHANGED
File without changes
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -0,0 +1,105 @@
|
|
1
|
+
DEPRECATION WARNING: Leaving `ActiveRecord::ConnectionAdapters::SQLite3Adapter.represent_boolean_as_integer`
|
2
|
+
set to false is deprecated. SQLite databases have used 't' and 'f' to serialize
|
3
|
+
boolean values and must have old data converted to 1 and 0 (its native boolean
|
4
|
+
serialization) before setting this flag to true. Conversion can be accomplished
|
5
|
+
by setting up a rake task which runs
|
6
|
+
|
7
|
+
ExampleModel.where("boolean_column = 't'").update_all(boolean_column: 1)
|
8
|
+
ExampleModel.where("boolean_column = 'f'").update_all(boolean_column: 0)
|
9
|
+
|
10
|
+
for all models and all boolean columns, after which the flag must be set to
|
11
|
+
true by adding the following to your application.rb file:
|
12
|
+
|
13
|
+
Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
|
14
|
+
(called from <main> at bin/rake:4)
|
15
|
+
[1m[35m (0.0ms)[0m [1m[35mDROP TABLE IF EXISTS "items"[0m
|
16
|
+
[1m[35m (0.0ms)[0m [1m[34mSELECT sqlite_version(*)[0m
|
17
|
+
[1m[35m (21.7ms)[0m [1m[35mCREATE TABLE "items" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
18
|
+
[1m[35m (0.1ms)[0m [1m[35mDROP TABLE IF EXISTS "users"[0m
|
19
|
+
[1m[35m (22.0ms)[0m [1m[35mCREATE TABLE "users" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
20
|
+
[1m[35m (4.5ms)[0m [1m[35mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)[0m
|
21
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
22
|
+
[1m[35m (3.2ms)[0m [1m[32mINSERT INTO "schema_migrations" (version) VALUES (20160602144324)[0m
|
23
|
+
[1m[35m (3.0ms)[0m [1m[32mINSERT INTO "schema_migrations" (version) VALUES
|
24
|
+
(20160602144150);
|
25
|
+
|
26
|
+
[0m
|
27
|
+
[1m[35m (3.5ms)[0m [1m[35mCREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
28
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.1ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", "environment"], ["LIMIT", 1]]
|
29
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
30
|
+
[1m[36mActiveRecord::InternalMetadata Create (0.1ms)[0m [1m[32mINSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["key", "environment"], ["value", "development"], ["created_at", "2021-01-16 06:42:28.980182"], ["updated_at", "2021-01-16 06:42:28.980182"]]
|
31
|
+
[1m[35m (3.1ms)[0m [1m[36mcommit transaction[0m
|
32
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.1ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", "environment"], ["LIMIT", 1]]
|
33
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
34
|
+
[1m[36mActiveRecord::InternalMetadata Update (0.1ms)[0m [1m[33mUPDATE "ar_internal_metadata" SET "value" = ?, "updated_at" = ? WHERE "ar_internal_metadata"."key" = ?[0m [["value", "test"], ["updated_at", "2021-01-16 06:42:28.985152"], ["key", "environment"]]
|
35
|
+
[1m[35m (3.1ms)[0m [1m[36mcommit transaction[0m
|
36
|
+
DEPRECATION WARNING: Leaving `ActiveRecord::ConnectionAdapters::SQLite3Adapter.represent_boolean_as_integer`
|
37
|
+
set to false is deprecated. SQLite databases have used 't' and 'f' to serialize
|
38
|
+
boolean values and must have old data converted to 1 and 0 (its native boolean
|
39
|
+
serialization) before setting this flag to true. Conversion can be accomplished
|
40
|
+
by setting up a rake task which runs
|
41
|
+
|
42
|
+
ExampleModel.where("boolean_column = 't'").update_all(boolean_column: 1)
|
43
|
+
ExampleModel.where("boolean_column = 'f'").update_all(boolean_column: 0)
|
44
|
+
|
45
|
+
for all models and all boolean columns, after which the flag must be set to
|
46
|
+
true by adding the following to your application.rb file:
|
47
|
+
|
48
|
+
Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
|
49
|
+
(called from <main> at bin/rake:4)
|
50
|
+
[1m[35m (0.0ms)[0m [1m[35mDROP TABLE IF EXISTS "items"[0m
|
51
|
+
[1m[35m (0.0ms)[0m [1m[34mSELECT sqlite_version(*)[0m
|
52
|
+
[1m[35m (21.6ms)[0m [1m[35mCREATE TABLE "items" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
53
|
+
[1m[35m (0.0ms)[0m [1m[35mDROP TABLE IF EXISTS "users"[0m
|
54
|
+
[1m[35m (22.3ms)[0m [1m[35mCREATE TABLE "users" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
55
|
+
[1m[35m (3.4ms)[0m [1m[35mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)[0m
|
56
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
57
|
+
[1m[35m (2.9ms)[0m [1m[32mINSERT INTO "schema_migrations" (version) VALUES (20160602144324)[0m
|
58
|
+
[1m[35m (2.8ms)[0m [1m[32mINSERT INTO "schema_migrations" (version) VALUES
|
59
|
+
(20160602144150);
|
60
|
+
|
61
|
+
[0m
|
62
|
+
[1m[35m (3.4ms)[0m [1m[35mCREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
63
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.1ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", "environment"], ["LIMIT", 1]]
|
64
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
65
|
+
[1m[36mActiveRecord::InternalMetadata Create (0.2ms)[0m [1m[32mINSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["key", "environment"], ["value", "development"], ["created_at", "2021-01-16 06:43:45.010142"], ["updated_at", "2021-01-16 06:43:45.010142"]]
|
66
|
+
[1m[35m (3.1ms)[0m [1m[36mcommit transaction[0m
|
67
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.1ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", "environment"], ["LIMIT", 1]]
|
68
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
69
|
+
[1m[36mActiveRecord::InternalMetadata Update (0.1ms)[0m [1m[33mUPDATE "ar_internal_metadata" SET "value" = ?, "updated_at" = ? WHERE "ar_internal_metadata"."key" = ?[0m [["value", "test"], ["updated_at", "2021-01-16 06:43:45.015286"], ["key", "environment"]]
|
70
|
+
[1m[35m (3.1ms)[0m [1m[36mcommit transaction[0m
|
71
|
+
DEPRECATION WARNING: Leaving `ActiveRecord::ConnectionAdapters::SQLite3Adapter.represent_boolean_as_integer`
|
72
|
+
set to false is deprecated. SQLite databases have used 't' and 'f' to serialize
|
73
|
+
boolean values and must have old data converted to 1 and 0 (its native boolean
|
74
|
+
serialization) before setting this flag to true. Conversion can be accomplished
|
75
|
+
by setting up a rake task which runs
|
76
|
+
|
77
|
+
ExampleModel.where("boolean_column = 't'").update_all(boolean_column: 1)
|
78
|
+
ExampleModel.where("boolean_column = 'f'").update_all(boolean_column: 0)
|
79
|
+
|
80
|
+
for all models and all boolean columns, after which the flag must be set to
|
81
|
+
true by adding the following to your application.rb file:
|
82
|
+
|
83
|
+
Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
|
84
|
+
(called from <main> at bin/rake:4)
|
85
|
+
[1m[35m (0.0ms)[0m [1m[35mDROP TABLE IF EXISTS "items"[0m
|
86
|
+
[1m[35m (0.0ms)[0m [1m[34mSELECT sqlite_version(*)[0m
|
87
|
+
[1m[35m (4.6ms)[0m [1m[35mCREATE TABLE "items" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
88
|
+
[1m[35m (0.0ms)[0m [1m[35mDROP TABLE IF EXISTS "users"[0m
|
89
|
+
[1m[35m (3.5ms)[0m [1m[35mCREATE TABLE "users" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
90
|
+
[1m[35m (3.4ms)[0m [1m[35mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)[0m
|
91
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
92
|
+
[1m[35m (2.8ms)[0m [1m[32mINSERT INTO "schema_migrations" (version) VALUES (20160602144324)[0m
|
93
|
+
[1m[35m (3.4ms)[0m [1m[32mINSERT INTO "schema_migrations" (version) VALUES
|
94
|
+
(20160602144150);
|
95
|
+
|
96
|
+
[0m
|
97
|
+
[1m[35m (3.9ms)[0m [1m[35mCREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
98
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.1ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", "environment"], ["LIMIT", 1]]
|
99
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
100
|
+
[1m[36mActiveRecord::InternalMetadata Create (0.1ms)[0m [1m[32mINSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["key", "environment"], ["value", "development"], ["created_at", "2021-01-16 06:49:23.447793"], ["updated_at", "2021-01-16 06:49:23.447793"]]
|
101
|
+
[1m[35m (2.7ms)[0m [1m[36mcommit transaction[0m
|
102
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.0ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", "environment"], ["LIMIT", 1]]
|
103
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
104
|
+
[1m[36mActiveRecord::InternalMetadata Update (0.1ms)[0m [1m[33mUPDATE "ar_internal_metadata" SET "value" = ?, "updated_at" = ? WHERE "ar_internal_metadata"."key" = ?[0m [["value", "test"], ["updated_at", "2021-01-16 06:49:23.451712"], ["key", "environment"]]
|
105
|
+
[1m[35m (2.7ms)[0m [1m[36mcommit transaction[0m
|