Skip to content

Commit

Permalink
Added support for Trilogy - closes #276
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Sep 13, 2023
1 parent 6ec508d commit d0ccde5
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 6.4.0 (unreleased)

- Added support for Trilogy

## 6.3.0 (2023-07-02)

- Dropped support for Ruby < 3 and Rails < 6.1
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ gem "minitest"
gem "activerecord", "~> 7.0.0"
gem "pg"
gem "mysql2"
gem "activerecord-trilogy-adapter"
gem "sqlite3"
gem "ruby-prof", require: false
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require "bundler/gem_tasks"
require "rake/testtask"

ADAPTERS = %w(postgresql mysql sqlite enumerable redshift)
ADAPTERS = %w(postgresql mysql trilogy sqlite enumerable redshift)

ADAPTERS.each do |adapter|
namespace :test do
Expand Down
1 change: 1 addition & 0 deletions gemfiles/activerecord61.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ gem "minitest"
gem "activerecord", "~> 6.1.0"
gem "pg"
gem "mysql2"
gem "activerecord-trilogy-adapter"
gem "sqlite3"
1 change: 1 addition & 0 deletions gemfiles/activerecord71.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ gem "minitest"
gem "activerecord", "7.1.0.beta1"
gem "pg"
gem "mysql2"
gem "trilogy"
gem "sqlite3"
2 changes: 1 addition & 1 deletion lib/groupdate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def self.register_adapter(name, adapter)
end
end

Groupdate.register_adapter ["Mysql2", "Mysql2Spatial", "Mysql2Rgeo"], Groupdate::Adapters::MySQLAdapter
Groupdate.register_adapter ["Mysql2", "Mysql2Spatial", "Mysql2Rgeo", "Trilogy"], Groupdate::Adapters::MySQLAdapter
Groupdate.register_adapter ["PostgreSQL", "PostGIS", "Redshift"], Groupdate::Adapters::PostgreSQLAdapter
Groupdate.register_adapter "SQLite", Groupdate::Adapters::SQLiteAdapter

Expand Down
6 changes: 6 additions & 0 deletions test/adapters/trilogy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
if ActiveRecord::VERSION::STRING.to_f < 7.1
require "trilogy_adapter/connection"
ActiveRecord::Base.public_send :extend, TrilogyAdapter::Connection
end

ActiveRecord::Base.establish_connection adapter: "trilogy", database: "groupdate_test"

0 comments on commit d0ccde5

Please sign in to comment.