sequent-rails 0.1.0

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.
Files changed (118) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +27 -0
  4. data/Rakefile +30 -0
  5. data/app/assets/config/sequent_rails_manifest.js +1 -0
  6. data/app/assets/stylesheets/sequent/application.css +15 -0
  7. data/app/assets/stylesheets/sequent/events.css +4 -0
  8. data/app/controllers/sequent/application_controller.rb +5 -0
  9. data/app/controllers/sequent/commands_controller.rb +13 -0
  10. data/app/controllers/sequent/events_controller.rb +23 -0
  11. data/app/controllers/sequent/streams_controller.rb +19 -0
  12. data/app/helpers/sequent/application_helper.rb +4 -0
  13. data/app/helpers/sequent/events_helper.rb +4 -0
  14. data/app/jobs/sequent/application_job.rb +4 -0
  15. data/app/mailers/sequent/application_mailer.rb +6 -0
  16. data/app/models/sequent/application_record.rb +5 -0
  17. data/app/views/layouts/sequent/application.html.erb +42 -0
  18. data/app/views/sequent/commands/show.html.erb +45 -0
  19. data/app/views/sequent/events/_event_record.html.erb +11 -0
  20. data/app/views/sequent/events/index.html.erb +30 -0
  21. data/app/views/sequent/events/show.html.erb +45 -0
  22. data/app/views/sequent/streams/_stream_record.html.erb +10 -0
  23. data/app/views/sequent/streams/index.html.erb +16 -0
  24. data/config/routes.rb +7 -0
  25. data/lib/generators/sequent_install_generator.rb +29 -0
  26. data/lib/generators/templates/db/create_event_store.rb +44 -0
  27. data/lib/sequent-rails.rb +8 -0
  28. data/lib/sequent-rails/engine.rb +9 -0
  29. data/lib/sequent-rails/railtie.rb +11 -0
  30. data/lib/sequent-rails/version.rb +3 -0
  31. data/lib/tasks/sequent/rails_tasks.rake +19 -0
  32. data/spec/controllers/sequent/commands_controller_spec.rb +13 -0
  33. data/spec/controllers/sequent/events_controller_spec.rb +21 -0
  34. data/spec/controllers/sequent/streams_controller_spec.rb +13 -0
  35. data/spec/dummy/Rakefile +6 -0
  36. data/spec/dummy/app/assets/config/manifest.js +3 -0
  37. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  38. data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
  39. data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
  40. data/spec/dummy/app/controllers/application_controller.rb +2 -0
  41. data/spec/dummy/app/domains/dummy.rb +28 -0
  42. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  43. data/spec/dummy/app/javascript/packs/application.js +15 -0
  44. data/spec/dummy/app/jobs/application_job.rb +7 -0
  45. data/spec/dummy/app/mailers/application_mailer.rb +4 -0
  46. data/spec/dummy/app/models/application_record.rb +3 -0
  47. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  48. data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
  49. data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
  50. data/spec/dummy/bin/rails +4 -0
  51. data/spec/dummy/bin/rake +4 -0
  52. data/spec/dummy/bin/setup +32 -0
  53. data/spec/dummy/bin/update +27 -0
  54. data/spec/dummy/config.ru +5 -0
  55. data/spec/dummy/config/application.rb +19 -0
  56. data/spec/dummy/config/boot.rb +5 -0
  57. data/spec/dummy/config/cable.yml +10 -0
  58. data/spec/dummy/config/database.yml +25 -0
  59. data/spec/dummy/config/environment.rb +5 -0
  60. data/spec/dummy/config/environments/development.rb +62 -0
  61. data/spec/dummy/config/environments/production.rb +112 -0
  62. data/spec/dummy/config/environments/test.rb +47 -0
  63. data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
  64. data/spec/dummy/config/initializers/assets.rb +12 -0
  65. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  66. data/spec/dummy/config/initializers/content_security_policy.rb +25 -0
  67. data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
  68. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  69. data/spec/dummy/config/initializers/inflections.rb +16 -0
  70. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  71. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  72. data/spec/dummy/config/locales/en.yml +33 -0
  73. data/spec/dummy/config/puma.rb +35 -0
  74. data/spec/dummy/config/routes.rb +3 -0
  75. data/spec/dummy/config/spring.rb +6 -0
  76. data/spec/dummy/config/storage.yml +34 -0
  77. data/spec/dummy/db/development.sqlite3 +0 -0
  78. data/spec/dummy/db/migrate/20190306181535_create_event_store.rb +44 -0
  79. data/spec/dummy/db/schema.rb +44 -0
  80. data/spec/dummy/db/sequent_schema.rb +51 -0
  81. data/spec/dummy/db/test.sqlite3 +0 -0
  82. data/spec/dummy/log/development.log +4533 -0
  83. data/spec/dummy/log/test.log +3523 -0
  84. data/spec/dummy/postgres +0 -0
  85. data/spec/dummy/public/404.html +67 -0
  86. data/spec/dummy/public/422.html +67 -0
  87. data/spec/dummy/public/500.html +66 -0
  88. data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
  89. data/spec/dummy/public/apple-touch-icon.png +0 -0
  90. data/spec/dummy/public/favicon.ico +0 -0
  91. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/1d/1dQeaWjMQHspoJITm3S5rKch7Na9LY8hEOuvV7-zpV0.cache +0 -0
  92. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/4u/4upH7Ppgh7FnLtwm4nA_acTB5-PGL0MFJUlyjF6e2Fs.cache +1 -0
  93. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/7P/7PS02kUE9Zs_4rX1yK2VjGjCTSYNqMf8W7hJ0rEEkM0.cache +1 -0
  94. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/At/AtH6UmnAL8UWD50ttSa4pOTWQSvzlU6sqB7yUMX7kxo.cache +1 -0
  95. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Bz/BzmMouzoHq2P5iUzSVty3FLpZJRHSZgyVU-gX5VaM9w.cache +0 -0
  96. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/CB/CBvcsH236VTECTQ1Nau3yiBbx4xm-6YzJLPOhZL-UcI.cache +0 -0
  97. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/CZ/CZ14YU2CmknFTo2fmCxnF3GX6GvfIBzUcAJPQrNVqnY.cache +2 -0
  98. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Jd/JdyGYcgVngpZ0ZvNH-NoNocc8Uc0OxOjzADBr_fdE1o.cache +2 -0
  99. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/O-/O-WYnJo6YnRKSnkmMhhm0yqdywR7ZMe3ZtUaH4CVHIY.cache +0 -0
  100. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Rl/RlXzNldRsfe_qJAbM0vxH2tPAdB8mjPMYVTzscDqBHQ.cache +2 -0
  101. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Tr/TrnRBzBupQnsm7FRKpjHzr-rur9n6E41wBhR5mCNOxM.cache +1 -0
  102. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/U0/U04DM1V7i_pb0XbkSMsKVmwmnlmPqTHKXp6RVsz6OtE.cache +1 -0
  103. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/VT/VTL3b-HPToYtYE2fOSpYLuYo5ii9yaJatDertXtDQQE.cache +1 -0
  104. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Xj/XjmI6iua5y59N4-RziEfKRchfYFNSSwwSyZIC6mzWAo.cache +1 -0
  105. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ZY/ZYGTEco0q8pXH0nLnNtIdi4sJT6RP3Opwonr5nXpcCI.cache +0 -0
  106. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/aw/awzofY3gI_LwBNk6Y6K7r_aYZiTQylZZQNAObbems2A.cache +0 -0
  107. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/h8/h88OM1n3S0NU75Avy6Cwv1eZBpJ0-CKSseVj9o3Z-5A.cache +1 -0
  108. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/iO/iOovmGrTgTMk6e-g3JCY133TBXG9mOx_7MGukjgXTIs.cache +0 -0
  109. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/lH/lH3cPMVbHurfIhlRo9w435AshPNIdg4Z44o0q2zwqyA.cache +1 -0
  110. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/n_/n_xYqQYhwEMQknb3jFQnjlxxBE9TzMNHCdJ-bEyZFIw.cache +2 -0
  111. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/nx/nxTv3sKVUQZADJyM3dPaVmUA78MIsMLD_K279yN_GsI.cache +2 -0
  112. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/qA/qAT0qzQX02MqiB2n7v1PG81xwe5IXG1KpgVPPLp2FrM.cache +1 -0
  113. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/s_/s_YjQyhcUDLVttYhyZ751NX0iyHYFYFSEG-ffw1zEqE.cache +1 -0
  114. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/tH/tHG2oi8K6QfFkmj3qWVTgDUV5DjzUT_g_mGt-CNzS7o.cache +3 -0
  115. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/wc/wc--IRm0aoGpFXGbBMkwSfBevbtd4_JLH4x1mQe7Z0E.cache +1 -0
  116. data/spec/rails_helper.rb +63 -0
  117. data/spec/spec_helper.rb +96 -0
  118. metadata +330 -0
@@ -0,0 +1,44 @@
1
+ class CreateEventStore < ActiveRecord::Migration<%= migration_version %>
2
+ def change
3
+
4
+ create_table "event_records", :force => :cascade do |t|
5
+ t.string "aggregate_id", null: false
6
+ t.integer "sequence_number", null: false
7
+ t.string "event_type", null: false
8
+ t.text "event_json", null: false
9
+ t.integer "command_record_id", null: false
10
+ t.integer "stream_record_id", null: false
11
+
12
+ t.datetime "created_at", null: false
13
+
14
+ unless ActiveRecord::Base.connection.instance_of? ActiveRecord::ConnectionAdapters::SQLite3Adapter
15
+ t.index "aggregate_id, sequence_number, (\nCASE event_type\n WHEN \"Sequent::Core::SnapshotEvent\"::text THEN 0\n ELSE 1\nEND)", name: "unique_event_per_aggregate", unique: true
16
+ t.index ["aggregate_id", "sequence_number"], name: "snapshot_events", order: { sequence_number: :desc }, where: "((event_type)::text = \"Sequent::Core::SnapshotEvent\"::text)"
17
+ end
18
+
19
+ t.index ["command_record_id"], name: "index_event_records_on_command_record_id"
20
+ t.index ["created_at"], name: "index_event_records_on_created_at"
21
+ t.index ["event_type"], name: "index_event_records_on_event_type"
22
+ end
23
+
24
+ create_table "command_records", force: :cascade do |t|
25
+ t.string "user_id"
26
+ t.string "aggregate_id"
27
+ t.string "command_type", null: false
28
+ t.text "command_json", null: false
29
+
30
+ t.datetime "created_at", null: false
31
+ end
32
+
33
+ create_table "stream_records", force: :cascade do |t|
34
+ t.string "aggregate_type", null: false
35
+ t.string "aggregate_id", null: false
36
+ t.integer "snapshot_threshold"
37
+
38
+ t.datetime "created_at", null: false
39
+
40
+ t.index ["aggregate_id"], name: "index_stream_records_on_aggregate_id", unique: true
41
+ end
42
+
43
+ end
44
+ end
@@ -0,0 +1,8 @@
1
+ require 'sequent'
2
+ require "sequent-rails/engine"
3
+ require "sequent-rails/railtie" if defined?(Rails)
4
+
5
+ module Sequent
6
+ # Your code goes here...
7
+ Sequent.configuration.database_config_directory = 'config'
8
+ end
@@ -0,0 +1,9 @@
1
+ module Sequent
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace Sequent
4
+
5
+ config.generators do |g|
6
+ g.test_framework :rspec
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ module Sequent
2
+ class Railtie < Rails::Railtie
3
+ rake_tasks do
4
+ load 'tasks/sequent/rails_tasks.rake'
5
+ end
6
+
7
+ generators do
8
+ require 'generators/sequent_install_generator.rb'
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ module SequentRails
2
+ VERSION = '0.1.0'
3
+ end
@@ -0,0 +1,19 @@
1
+ # desc "Explaining what the task does"
2
+ # task :sequent_rails do
3
+ # # Task goes here
4
+ # end
5
+ #
6
+ load "sequent/rake/tasks.rb"
7
+ load "sequent/rake/migration_tasks.rb"
8
+
9
+ ENV['RACK_ENV'] ||= 'development'
10
+ Sequent::Rake::MigrationTasks.new.register_tasks!
11
+
12
+ namespace :sequent do
13
+ desc 'and installs the event_store schema if it does not exist'
14
+ task :init do
15
+
16
+ puts 'does stuff'
17
+
18
+ end
19
+ end
@@ -0,0 +1,13 @@
1
+ require 'rails_helper'
2
+
3
+ RSpec.describe Sequent::CommandsController, type: :controller do
4
+ routes { Sequent::Engine.routes }
5
+
6
+ describe "GET #show" do
7
+ it "returns http success" do
8
+ Sequent.command_service.execute_commands SomeCommand.new(some_value: 1, aggregate_id: 'gaargergtte')
9
+ get :show, params: { id: Sequent::Core::CommandRecord.last.id }
10
+ expect(response).to have_http_status(:success)
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,21 @@
1
+ require 'rails_helper'
2
+ require_relative '../../dummy/app/domains/dummy'
3
+
4
+ RSpec.describe Sequent::EventsController do
5
+ routes { Sequent::Engine.routes }
6
+
7
+ describe "GET #index" do
8
+ it "returns http success" do
9
+ get :index
10
+ expect(response).to have_http_status(:success)
11
+ end
12
+ end
13
+
14
+ describe "GET #show" do
15
+ it "returns http success" do
16
+ Sequent.command_service.execute_commands SomeCommand.new(some_value: 1, aggregate_id: 'gaargergtte')
17
+ get :show, params: { id: Sequent::Core::EventRecord.last.id }
18
+ expect(response).to have_http_status(:success)
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,13 @@
1
+ require 'rails_helper'
2
+
3
+ RSpec.describe Sequent::StreamsController, type: :controller do
4
+ routes { Sequent::Engine.routes }
5
+
6
+ describe "GET #index" do
7
+ it "returns http success" do
8
+ get :index
9
+ expect(response).to have_http_status(:success)
10
+ end
11
+ end
12
+
13
+ end
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require_relative 'config/application'
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,3 @@
1
+ //= link_tree ../images
2
+ //= link_directory ../stylesheets .css
3
+ //= link sequent_rails_manifest.js
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Channel < ActionCable::Channel::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Connection < ActionCable::Connection::Base
3
+ end
4
+ end
@@ -0,0 +1,2 @@
1
+ class ApplicationController < ActionController::Base
2
+ end
@@ -0,0 +1,28 @@
1
+ class ValueAdded < Sequent::Event
2
+ attrs some_value: String
3
+ end
4
+
5
+ class SomeCommand < Sequent::Command
6
+ attrs some_value: String
7
+ end
8
+
9
+ class DummyAggregate < Sequent::AggregateRoot
10
+ def set_value(value)
11
+ apply ValueAdded, some_value: value
12
+ end
13
+
14
+ on ValueAdded do |event|
15
+ @some_value = event.some_value
16
+ end
17
+ end
18
+
19
+ class DummyCommandHandler < Sequent::CommandHandler
20
+ on SomeCommand do |command|
21
+ aggregate = repository.add_aggregate(DummyAggregate.new command.aggregate_id)
22
+ aggregate.set_value(command.some_value)
23
+ end
24
+ end
25
+
26
+ Sequent.configure do |config|
27
+ config.command_handlers << DummyCommandHandler.new
28
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,15 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file. JavaScript code in this file should be added after the last require_* statement.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require rails-ujs
14
+ //= require activestorage
15
+ //= require_tree .
@@ -0,0 +1,7 @@
1
+ class ApplicationJob < ActiveJob::Base
2
+ # Automatically retry jobs that encountered a deadlock
3
+ # retry_on ActiveRecord::Deadlocked
4
+
5
+ # Most jobs are safe to ignore if the underlying records are no longer available
6
+ # discard_on ActiveJob::DeserializationError
7
+ end
@@ -0,0 +1,4 @@
1
+ class ApplicationMailer < ActionMailer::Base
2
+ default from: 'from@example.com'
3
+ layout 'mailer'
4
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ self.abstract_class = true
3
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= csrf_meta_tags %>
6
+ <%= csp_meta_tag %>
7
+
8
+ <%= stylesheet_link_tag 'application', media: 'all' %>
9
+ </head>
10
+
11
+ <body>
12
+ <%= yield %>
13
+ </body>
14
+ </html>
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <style>
6
+ /* Email styles need to be inline */
7
+ </style>
8
+ </head>
9
+
10
+ <body>
11
+ <%= yield %>
12
+ </body>
13
+ </html>
@@ -0,0 +1 @@
1
+ <%= yield %>
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../config/application', __dir__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env ruby
2
+ require 'fileutils'
3
+
4
+ # path to your application root.
5
+ APP_ROOT = File.expand_path('..', __dir__)
6
+
7
+ def system!(*args)
8
+ system(*args) || abort("\n== Command #{args} failed ==")
9
+ end
10
+
11
+ FileUtils.chdir APP_ROOT do
12
+ # This script is a starting point to setup your application.
13
+ # Add necessary setup steps to this file.
14
+
15
+ puts '== Installing dependencies =='
16
+ system! 'gem install bundler --conservative'
17
+ system('bundle check') || system!('bundle install')
18
+
19
+ # puts "\n== Copying sample files =="
20
+ # unless File.exist?('config/database.yml')
21
+ # FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
22
+ # end
23
+
24
+ puts "\n== Preparing database =="
25
+ system! 'bin/rails db:setup'
26
+
27
+ puts "\n== Removing old logs and tempfiles =="
28
+ system! 'bin/rails log:clear tmp:clear'
29
+
30
+ puts "\n== Restarting application server =="
31
+ system! 'bin/rails restart'
32
+ end
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ require 'fileutils'
3
+
4
+ # path to your application root.
5
+ APP_ROOT = File.expand_path('..', __dir__)
6
+
7
+ def system!(*args)
8
+ system(*args) || abort("\n== Command #{args} failed ==")
9
+ end
10
+
11
+ FileUtils.chdir APP_ROOT do
12
+ # This script is a way to update your development environment automatically.
13
+ # Add necessary update steps to this file.
14
+
15
+ puts '== Installing dependencies =='
16
+ system! 'gem install bundler --conservative'
17
+ system('bundle check') || system!('bundle install')
18
+
19
+ puts "\n== Updating database =="
20
+ system! 'rails db:migrate'
21
+
22
+ puts "\n== Removing old logs and tempfiles =="
23
+ system! 'rails log:clear tmp:clear'
24
+
25
+ puts "\n== Restarting application server =="
26
+ system! 'rails restart'
27
+ end
@@ -0,0 +1,5 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require_relative 'config/environment'
4
+
5
+ run Rails.application
@@ -0,0 +1,19 @@
1
+ require_relative 'boot'
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require(*Rails.groups)
6
+ require "sequent-rails"
7
+
8
+ module Dummy
9
+ class Application < Rails::Application
10
+ # Initialize configuration defaults for originally generated Rails version.
11
+ config.load_defaults 6.0
12
+
13
+ # Settings in config/environments/* take precedence over those specified here.
14
+ # Application configuration can go into files in config/initializers
15
+ # -- all .rb files in that directory are automatically loaded after loading
16
+ # the framework and any gems in your application.
17
+ end
18
+ end
19
+
@@ -0,0 +1,5 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
3
+
4
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.unshift File.expand_path('../../../lib', __dir__)
@@ -0,0 +1,10 @@
1
+ development:
2
+ adapter: async
3
+
4
+ test:
5
+ adapter: test
6
+
7
+ production:
8
+ adapter: redis
9
+ url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10
+ channel_prefix: dummy_production
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: db/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: db/test.sqlite3
22
+
23
+ production:
24
+ <<: *default
25
+ database: db/production.sqlite3