From 0d3f84561dd1b48878f2e7a964ee543a4d4b3bda Mon Sep 17 00:00:00 2001 From: Lars Vonk Date: Tue, 7 Nov 2023 15:01:40 +0100 Subject: [PATCH] Update sequent to version 7 --- building-a-web-application/Gemfile.lock | 12 ++++++------ building-a-web-application/README.md | 4 ++-- .../config/initializers/sequent.rb | 11 +---------- rails-blog/Gemfile.lock | 8 ++++---- rails-blog/config/initializers/sequent.rb | 9 +-------- 5 files changed, 14 insertions(+), 30 deletions(-) diff --git a/building-a-web-application/Gemfile.lock b/building-a-web-application/Gemfile.lock index 05df623..adbf6c1 100644 --- a/building-a-web-application/Gemfile.lock +++ b/building-a-web-application/Gemfile.lock @@ -1,10 +1,10 @@ GIT remote: https://github.com/zilverline/sequent.git - revision: 4387610ef7fc7dbaa0ffdb724d968fdb0d5e19ae + revision: 498812fb86edd319310be5b6ea2d53719e81cf14 specs: - sequent (6.0.2) - activemodel (>= 5.0, < 7.1) - activerecord (>= 5.0, < 7.1) + sequent (7.0.1) + activemodel (>= 5.0, < 7.2) + activerecord (>= 5.0, < 7.2) bcrypt (~> 3.1) i18n oj (~> 3) @@ -46,13 +46,13 @@ GEM ruby2_keywords (~> 0.0.1) oj (3.16.1) parallel (1.23.0) - parser (3.2.2.3) + parser (3.2.2.4) ast (~> 2.4.1) racc pg (1.5.4) postgresql_cursor (0.6.8) activerecord (>= 6.0) - racc (1.7.1) + racc (1.7.3) rack (2.2.8) rack-protection (3.0.4) rack diff --git a/building-a-web-application/README.md b/building-a-web-application/README.md index 3f6a911..c725a99 100644 --- a/building-a-web-application/README.md +++ b/building-a-web-application/README.md @@ -39,11 +39,11 @@ To create the test database: ``` cd building-a-web-application -RACK_ENV=test bundle exec rake sequent:db:create +SEQUENT_ENV=test bundle exec rake sequent:db:create ``` And running the spec: ``` -RACK_ENV=test bundle exec rspec +SEQUENT_ENV=test bundle exec rspec ``` diff --git a/building-a-web-application/config/initializers/sequent.rb b/building-a-web-application/config/initializers/sequent.rb index 5ffcbee..d85c415 100644 --- a/building-a-web-application/config/initializers/sequent.rb +++ b/building-a-web-application/config/initializers/sequent.rb @@ -2,14 +2,5 @@ Sequent.configure do |config| config.migrations_class_name = 'Migrations' - - config.command_handlers = [ - PostCommandHandler, - AuthorCommandHandler, - ].map(&:new) - - config.event_handlers = [ - PostProjector, - AuthorProjector - ].map(&:new) + config.enable_autoregistration = true end diff --git a/rails-blog/Gemfile.lock b/rails-blog/Gemfile.lock index 05cf9c9..155f9a5 100644 --- a/rails-blog/Gemfile.lock +++ b/rails-blog/Gemfile.lock @@ -1,10 +1,10 @@ GIT remote: https://github.com/zilverline/sequent.git - revision: 4387610ef7fc7dbaa0ffdb724d968fdb0d5e19ae + revision: 498812fb86edd319310be5b6ea2d53719e81cf14 specs: - sequent (6.0.2) - activemodel (>= 5.0, < 7.1) - activerecord (>= 5.0, < 7.1) + sequent (7.0.1) + activemodel (>= 5.0, < 7.2) + activerecord (>= 5.0, < 7.2) bcrypt (~> 3.1) i18n oj (~> 3) diff --git a/rails-blog/config/initializers/sequent.rb b/rails-blog/config/initializers/sequent.rb index 06ed43f..bef7561 100644 --- a/rails-blog/config/initializers/sequent.rb +++ b/rails-blog/config/initializers/sequent.rb @@ -3,14 +3,7 @@ Rails.application.reloader.to_prepare do Sequent.configure do |config| config.migrations_class_name = 'SequentMigrations' - - config.command_handlers = [ - Post::PostCommandHandler.new, - ] - - config.event_handlers = [ - Post::PostProjector.new, - ] + config.enable_autoregistration = true config.logger = Logger.new(STDOUT)