Skip to content

Commit

Permalink
Upgrade ActiveStar to 7.2
Browse files Browse the repository at this point in the history
Two notable changes:

- `establish_connection` defers actually making the connection until usage. So `active?` no longer returns true after calling `establish_connection`.
- `quote_table_name` is no longer implemented in the module and should
be called on the actual connection.
  • Loading branch information
lvonk committed Sep 10, 2024
1 parent b1d17e3 commit 135fd94
Show file tree
Hide file tree
Showing 5 changed files with 151 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
include:
- ruby-version: 3.3
gemfile: 'ar_7_1'
- ruby-version: 3.3
gemfile: 'ar_7_2'
- ruby-version: 3.2
gemfile: 'ar_7_1'
- ruby-version: 3.2
Expand Down
10 changes: 10 additions & 0 deletions gemfiles/ar_7_2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

source 'https://rubygems.org'

active_star_version = '= 7.2.1'

gem 'activemodel', active_star_version
gem 'activerecord', active_star_version

gemspec path: '../'
131 changes: 131 additions & 0 deletions gemfiles/ar_7_2.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
PATH
remote: ..
specs:
sequent (7.0.1)
activemodel (>= 6.0)
activerecord (>= 6.0)
bcrypt (~> 3.1)
i18n
oj (~> 3)
parallel (~> 1.20)
parser (>= 2.6.5, < 3.4)
pg (~> 1.2)
postgresql_cursor (~> 0.6)
thread_safe (~> 0.3.6)
tzinfo (>= 1.1)

GEM
remote: https://rubygems.org/
specs:
activemodel (7.2.1)
activesupport (= 7.2.1)
activerecord (7.2.1)
activemodel (= 7.2.1)
activesupport (= 7.2.1)
timeout (>= 0.4.0)
activesupport (7.2.1)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
ast (2.4.2)
base64 (0.2.0)
bcrypt (3.1.20)
bigdecimal (3.1.8)
coderay (1.1.3)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
diff-lcs (1.5.1)
docile (1.4.1)
drb (2.2.1)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
json (2.7.2)
language_server-protocol (3.17.0.3)
logger (1.6.1)
method_source (1.1.0)
minitest (5.25.1)
oj (3.16.6)
bigdecimal (>= 3.0)
ostruct (>= 0.2)
ostruct (0.6.0)
parallel (1.26.3)
parser (3.3.5.0)
ast (~> 2.4.1)
racc
pg (1.5.8)
postgresql_cursor (0.6.9)
activerecord (>= 6.0)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.9.2)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-collection_matchers (1.2.1)
rspec-expectations (>= 2.99.0.beta1)
rspec-core (3.13.1)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.66.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.32.3)
parser (>= 3.3.1.0)
ruby-progressbar (1.13.0)
securerandom (0.3.1)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4)
thread_safe (0.3.6)
timecop (0.9.10)
timeout (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)

PLATFORMS
arm64-darwin-23

DEPENDENCIES
activemodel (= 7.2.1)
activerecord (= 7.2.1)
pry (~> 0.13)
rake (~> 13)
rspec (~> 3.10)
rspec-collection_matchers (~> 1.2)
rspec-mocks (~> 3.10)
rubocop (~> 1.56, >= 1.56.3)
sequent!
simplecov (~> 0.21)
timecop (~> 0.9)

BUNDLED WITH
2.3.24
4 changes: 4 additions & 0 deletions lib/sequent/core/event_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ def find_event_stream(aggregate_id)

private

def quote_table_name(table_name)
Sequent.configuration.event_record_class.connection.quote_table_name(table_name)
end

def event_types
@event_types = if Sequent.configuration.event_store_cache_event_types
ThreadSafe::Cache.new
Expand Down
4 changes: 4 additions & 0 deletions spec/lib/sequent/support/database_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@
after do
Sequent::Support::Database.disconnect!
Sequent::Support::Database.drop!(db_config)
Sequent::Support::Database.disconnect!
end

it 'connects the Sequent::ApplicationRecord pool' do
Sequent::Support::Database.establish_connection(db_config)
Sequent::ApplicationRecord.connection.connect!
expect(Sequent::ApplicationRecord.connection).to be_active
end
end
Expand All @@ -60,6 +62,7 @@

it 'connects the Sequent::ApplicationRecord pool' do
Sequent::Support::Database.with_schema_search_path('test2', db_config) do
Sequent::ApplicationRecord.connection.connect!
expect(Sequent::ApplicationRecord.connection).to be_active
end
end
Expand Down Expand Up @@ -171,6 +174,7 @@

it 'connects using an url option' do
Sequent::Support::Database.establish_connection(db_config)
Sequent::ApplicationRecord.connection.connect!
expect(Sequent::ApplicationRecord.connection).to be_active
end
end
Expand Down

0 comments on commit 135fd94

Please sign in to comment.