Skip to content

Commit

Permalink
Drop Ruby 3.0 and Rails 6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nashby committed Feb 22, 2025
1 parent f6a4de8 commit efd6153
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 39 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby-version: ['3.0', '3.1', '3.2', '3.3']
ruby-version: ['3.1', '3.2', '3.3']
test: ['minitest', 'rspec']
gemfile:
- Gemfile.rails61
- Gemfile.rails70
- Gemfile.rails71
- Gemfile.rails80
- Gemfile.railsmaster
- Gemfile.mongo_mapper
db:
Expand All @@ -47,11 +47,9 @@ jobs:
exclude:
- gemfile: Gemfile.mongo_mapper
db: postgresql
- ruby-version: '3.0'
gemfile: Gemfile.mongo_mapper
- ruby-version: '3.1'
gemfile: Gemfile.mongo_mapper
- ruby-version: '3.0'
- ruby-version: '3.1'
gemfile: Gemfile.railsmaster
env:
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## master

### bug fix

### enchancements

* Support only Ruby 3.1+ and Rails 7.0+. (by [@nashby](https://github.com/nashby))

## 2.8.1 (March 25, 2024)

### bug fix
Expand Down
9 changes: 0 additions & 9 deletions Gemfile.rails61

This file was deleted.

8 changes: 8 additions & 0 deletions Gemfile.rails80
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
eval_gemfile('Gemfile.global')

gem 'minitest', '~> 5.8'
gem 'rails', github: 'rails/rails', branch: '8-0-stable', require: false

gem 'mongoid', github: 'mongodb/mongoid'

gem 'sqlite3', platforms: [:ruby, :mswin, :mingw]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ Or install it yourself as:

## Supported Versions

- Ruby 3.0+
- Rails 6.1+
- Ruby 3.1+
- Rails 7.0+

## Usage

Expand Down
4 changes: 0 additions & 4 deletions lib/enumerize/activerecord.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ def enumerize(name, options={})
attribute(name) do |subtype|
Type.new(enumerized_attributes[name], subtype)
end
elsif ::ActiveRecord.version >= ::Gem::Version.new("6.1.0.alpha")
decorate_attribute_type(name.to_s) do |subtype|
Type.new(enumerized_attributes[name], subtype)
end
else
decorate_attribute_type(name, :enumerize) do |subtype|
Type.new(enumerized_attributes[name], subtype)
Expand Down
36 changes: 17 additions & 19 deletions test/activerecord_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -731,29 +731,27 @@ class AdminUser < User
expect(admin.account_type).must_equal 'pro'
end

if Rails::VERSION::MAJOR >= 6
it 'supports AR#insert_all' do
User.delete_all
it 'supports AR#insert_all' do
User.delete_all

User.insert_all([{ sex: :male }])
User.insert_all([{ status: :active }])
User.insert_all([{ interests: [:music, :sports] }])
User.insert_all([{ sex: :male }])
User.insert_all([{ status: :active }])
User.insert_all([{ interests: [:music, :sports] }])

expect(User.exists?(sex: :male)).must_equal true
expect(User.exists?(status: :active)).must_equal true
expect(User.exists?(interests: [:music, :sports])).must_equal true
end
expect(User.exists?(sex: :male)).must_equal true
expect(User.exists?(status: :active)).must_equal true
expect(User.exists?(interests: [:music, :sports])).must_equal true
end

it 'supports AR#upsert_all' do
User.delete_all
it 'supports AR#upsert_all' do
User.delete_all

User.upsert_all([{ sex: :male }])
User.upsert_all([{ status: :active }])
User.upsert_all([{ interests: [:music, :sports] }])
User.upsert_all([{ sex: :male }])
User.upsert_all([{ status: :active }])
User.upsert_all([{ interests: [:music, :sports] }])

expect(User.exists?(sex: :male)).must_equal true
expect(User.exists?(status: :active)).must_equal true
expect(User.exists?(interests: [:music, :sports])).must_equal true
end
expect(User.exists?(sex: :male)).must_equal true
expect(User.exists?(status: :active)).must_equal true
expect(User.exists?(interests: [:music, :sports])).must_equal true
end
end

0 comments on commit efd6153

Please sign in to comment.