Skip to content

Commit

Permalink
Merge pull request #30 from alpaca-tc/support-rails-8
Browse files Browse the repository at this point in the history
Remove eol rails 6.1 & add rails 8.0
  • Loading branch information
alpaca-tc authored Nov 11, 2024
2 parents 5e541fb + a293e28 commit be70ba9
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
gemfile: ['6.1_stable', '7.0_stable', '7.1_stable', '7.2_stable']
gemfile: ['7.0_stable', '7.1_stable', '7.2_stable', '8.0_stable']
ruby-version: ['3.1', '3.2', '3.3']
exclude:
- ruby-version: '3.1'
gemfile: '8.0_stable'
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
steps:
Expand Down
9 changes: 4 additions & 5 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# frozen_string_literal: true

appraise '6.1-stable' do
gem 'activerecord', '~> 6.1.0'
gem 'sqlite3', '~> 1.7.0'
end

appraise '7.0-stable' do
gem 'activerecord', '~> 7.0.0'
gem 'sqlite3', '~> 1.7.0'
Expand All @@ -18,3 +13,7 @@ end
appraise '7.2-stable' do
gem 'activerecord', '~> 7.2.0'
end

appraise '8.0-stable' do
gem 'activerecord', '~> 8.0.0'
end
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 3.0.0

* **Breaking Changes** Rails 6.1 is no longer supported. #30
* Support Rails 8.0.0 #30

## 2.0.0

* **Breaking Changes** Rails 6.0 is no longer supported. #28
Expand Down
2 changes: 1 addition & 1 deletion active_record_bitmask.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ Gem::Specification.new do |spec|
end
spec.require_paths = ['lib']

spec.add_dependency 'activerecord', '>= 6.1'
spec.add_dependency 'activerecord', '>= 7.0'
end
4 changes: 2 additions & 2 deletions gemfiles/6.1_stable.gemfile → gemfiles/8.0_stable.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gem "rubocop", "1.28.2"
gem "appraisal"
gem "rake"
gem "rspec"
gem "sqlite3", "~> 1.7.0"
gem "activerecord", "~> 6.1.0"
gem "sqlite3"
gem "activerecord", "~> 8.0.0"

gemspec path: "../"
9 changes: 2 additions & 7 deletions lib/active_record_bitmask/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,15 @@ def bitmask_for(attribute)

def define_bitmask_attribute(attribute, map)
if ActiveRecord.gem_version >= Gem::Version.new('7.2.0')
# Greater than or equal to 7.0.0
# Greater than or equal to 7.2.0
decorate_attributes([attribute]) do |name, subtype|
ActiveRecordBitmask::BitmaskType.new(name, map, subtype)
end
elsif ActiveRecord.gem_version >= Gem::Version.new('7.0.0')
else
# Greater than or equal to 7.0.0
attribute(attribute) do |subtype|
ActiveRecordBitmask::BitmaskType.new(attribute, map, subtype)
end
else
# Equal to 6.1.0
decorate_attribute_type(attribute) do |subtype|
ActiveRecordBitmask::BitmaskType.new(attribute, map, subtype)
end
end
end

Expand Down

0 comments on commit be70ba9

Please sign in to comment.