Skip to content

Drop support for versions below Ruby 3.2 and Rails 7.1 #383

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
8 changes: 0 additions & 8 deletions gemfiles/rails_61.gemfile

This file was deleted.

8 changes: 0 additions & 8 deletions gemfiles/rails_70.gemfile

This file was deleted.

5 changes: 1 addition & 4 deletions lib/sorcery/adapters/mongoid_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 = {})
Expand Down
2 changes: 1 addition & 1 deletion sorcery.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
17 changes: 2 additions & 15 deletions spec/support/migration_helper.rb
Original file line number Diff line number Diff line change
@@ -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