diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index ee659a57..5c87d4bc 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -17,36 +17,14 @@ jobs: fail-fast: false matrix: ruby: - - '3.0' - - '3.1' - '3.2' - '3.3' - '3.4' rails: - - '61' - - '70' - '71' - '72' - '80' - - exclude: - - ruby: '3.4' - rails: '70' - - ruby: '3.4' - rails: '61' - - ruby: '3.3' - rails: '70' - - ruby: '3.3' - rails: '61' - - ruby: '3.2' - rails: '61' - - ruby: '3.0' - rails: '72' - - ruby: '3.0' - rails: '80' - - ruby: '3.1' - rails: '80' env: BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.gemfile diff --git a/CHANGELOG.md b/CHANGELOG.md index d6642cd6..37c71ae7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog ## HEAD + +* Drop support for versions below Ruby 3.2 and Rails 7.1 [#383](https://github.com/Sorcery/sorcery/pull/383) * Remove the dependency on OpenStruct in the test code [#382](https://github.com/Sorcery/sorcery/pull/382) * Add Ruby 3.4 to CI matrix [#381](https://github.com/Sorcery/sorcery/pull/381) * Fix CI failures [#379](https://github.com/Sorcery/sorcery/pull/379) diff --git a/gemfiles/rails_61.gemfile b/gemfiles/rails_61.gemfile deleted file mode 100644 index 402ccbbf..00000000 --- a/gemfiles/rails_61.gemfile +++ /dev/null @@ -1,8 +0,0 @@ -source 'https://rubygems.org' - -gem 'rails', '~> 6.1.0' -gem 'concurrent-ruby', '1.3.4' -gem 'rails-controller-testing' -gem 'sqlite3', '~> 1.4' -gem 'rspec-rails', '>= 5.0' -gemspec path: '..' diff --git a/gemfiles/rails_70.gemfile b/gemfiles/rails_70.gemfile deleted file mode 100644 index e1d71cec..00000000 --- a/gemfiles/rails_70.gemfile +++ /dev/null @@ -1,8 +0,0 @@ -source 'https://rubygems.org' - -gem 'rails', '~> 7.0.0' -gem 'concurrent-ruby', '1.3.4' -gem 'rails-controller-testing' -gem 'sqlite3', '~> 1.4' -gem 'rspec-rails', '>= 6.0' -gemspec path: '..' diff --git a/lib/sorcery/adapters/mongoid_adapter.rb b/lib/sorcery/adapters/mongoid_adapter.rb index 438a5095..b03f4907 100644 --- a/lib/sorcery/adapters/mongoid_adapter.rb +++ b/lib/sorcery/adapters/mongoid_adapter.rb @@ -2,7 +2,7 @@ module Sorcery module Adapters class MongoidAdapter < BaseAdapter def increment(attr) - mongoid_4? ? @model.inc(attr => 1) : @model.inc(attr, 1) + @model.inc(attr => 1) end def update_attributes(attrs) @@ -22,9 +22,6 @@ def save(options = {}) @model.send(mthd, options) end - def mongoid_4? - Gem::Version.new(::Mongoid::VERSION) >= Gem::Version.new('4.0.0.alpha') - end class << self def define_field(name, type, options = {}) diff --git a/sorcery.gemspec b/sorcery.gemspec index 26942d42..82ed5106 100644 --- a/sorcery.gemspec +++ b/sorcery.gemspec @@ -32,7 +32,7 @@ Gem::Specification.new do |s| s.licenses = ['MIT'] - s.required_ruby_version = '>= 3.0.0' + s.required_ruby_version = '>= 3.2.0' s.add_dependency 'bcrypt', '~> 3.1' s.add_dependency 'oauth', '>= 0.6' diff --git a/spec/support/migration_helper.rb b/spec/support/migration_helper.rb index 94eaf1d3..8bbe5cb7 100644 --- a/spec/support/migration_helper.rb +++ b/spec/support/migration_helper.rb @@ -1,24 +1,11 @@ class MigrationHelper class << self def migrate(path) - if Rails.version >= '7.0' - ActiveRecord::MigrationContext.new(path).migrate - elsif Rails.version < '7.0' - ActiveRecord::MigrationContext.new(path, schema_migration).migrate - end + ActiveRecord::MigrationContext.new(path).migrate end def rollback(path) - if Rails.version >= '7.0' - ActiveRecord::MigrationContext.new(path).rollback - elsif Rails.version < '7.0' - ActiveRecord::MigrationContext.new(path, schema_migration).rollback - end - end - - private - def schema_migration - ActiveRecord::Base.connection.schema_migration + ActiveRecord::MigrationContext.new(path).rollback end end end