Skip to content

Commit

Permalink
Merge pull request #27 from alpaca-tc/support-rails-7-2
Browse files Browse the repository at this point in the history
Support Rails 7.2.0
  • Loading branch information
alpaca-tc authored Aug 13, 2024
2 parents 9f79299 + ca3fecd commit 135aaee
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.1', '3.2']
ruby-version: ['3.1', '3.2', '3.3']

steps:
- uses: actions/checkout@v4
Expand All @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
gemfile: ['6.1_stable', '7.0_stable', '7.1_stable']
gemfile: ['6.1_stable', '7.0_stable', '7.1_stable', '7.2_stable']
ruby-version: ['3.1', '3.2', '3.3']
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
Expand Down
4 changes: 4 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ appraise '7.1-stable' do
gem 'activerecord', '~> 7.1.0'
gem 'sqlite3', '~> 1.7.0'
end

appraise '7.2-stable' do
gem 'activerecord', '~> 7.2.0'
end
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Next Version

* **Breaking Changes** Rails 6.0 is no longer supported. #28
* Support Rails 7.2.0 #27

## 1.0.0

Expand Down
13 changes: 13 additions & 0 deletions gemfiles/7.2_stable.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "pry"
gem "rubocop", "1.28.2"
gem "appraisal"
gem "rake"
gem "rspec"
gem "sqlite3"
gem "activerecord", "~> 7.2.0"

gemspec path: "../"
7 changes: 6 additions & 1 deletion lib/active_record_bitmask/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ def bitmask_for(attribute)
private

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

0 comments on commit 135aaee

Please sign in to comment.