Skip to content
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

chore: upgrade to rails 7.2, ruby {3.2, 3.3} and add test config #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
10 changes: 7 additions & 3 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
branches: ['master']
schedule:
- cron: '0 0 * * 0'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please consider carefully if you might need to remove this cron.. If you maintain this, the testing will be run once a week and last time, the test failed unexpectedly while nothing has changed.

You might want to investigate those as well

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added workflow_dispatch trigger to run actions manually to resolve intermittent failures.

workflow_dispatch:

permissions:
contents: read
Expand All @@ -23,12 +24,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.0', '3.1', '3.2']
activerecord: ['6.0', '6.1', '7.0', '7.1']
ruby-version: ['3.0', '3.1', '3.2', '3.3']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, since now we're already in Rails 7.0 and Ruby 3.1, we only need the testing for

  • Rails 7.0, 7.1, 7.2
  • Ruby 3.1, 3.2, 3.3

The inclusion of Rails 6.0, 6.1 and also Ruby 3.0 is okay, just that it's redundant for our codebase (this library is only for our internal usage anyway)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the rails 6 configurations, leaving behind rails 7.0, 7.1, 7.2 and Ruby 3.0, 3.1, 3.2, 3.3.

activerecord: ['7.0', '7.1', '7.2']
exclude:
- ruby-version: '3.0'
activerecord: '7.2'
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.activerecord }}.gemfile
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Ruby
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
# change this to (see https://github.com/ruby/setup-ruby#versioning):
Expand Down
12 changes: 4 additions & 8 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
appraise "rails-6.0" do
gem 'rails', '6.0.6.1'
end

appraise "rails-6.1" do
gem 'rails', '~> 6.1'
end

appraise "rails-7.0" do
gem 'rails', '~> 7.0'
end

appraise "rails-7.1" do
gem 'rails', '~> 7.1'
end

appraise "rails-7.2" do
gem 'rails', '~> 7.2'
end
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [4.0.1] - 2024-09-04

### Added

- Add support for rails 7.2
- Add support for ruby 3.2 and 3.3

### Removed

- Remove support for rails 6.x

## [4.0.0] - 2024-06-03

### Added
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in active_record-acts_as.gemspec
gemspec

gem 'coveralls', require: false
gem 'coveralls_reborn', require: false
6 changes: 3 additions & 3 deletions active_record-acts_as.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require 'active_record/acts_as/version'
Gem::Specification.new do |spec|
spec.name = "active_record-acts_as"
spec.version = ActiveRecord::ActsAs::VERSION
spec.authors = ["Hassan Zamani", "Manuel Meurer"]
spec.authors = ["Hassan Zamani", "Manuel Meurer", "Bivan Alzacky Harmanto", "Adi Suryanata Herwana"]
spec.email = ["[email protected]", "[email protected]"]
spec.summary = %q{Simulate multi-table inheritance for activerecord models}
spec.description = %q{Simulate multi-table inheritance for activerecord models using a plymorphic association}
Expand All @@ -28,6 +28,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "appraisal", "~> 2.1"
spec.add_development_dependency "guard-rspec", "~> 4.7"

spec.add_dependency "activesupport", ">= 6.0"
spec.add_dependency "activerecord", ">= 6.0"
spec.add_dependency "activesupport", ">= 7.0"
spec.add_dependency "activerecord", ">= 7.0"
end
8 changes: 0 additions & 8 deletions gemfiles/rails_6.1.gemfile

This file was deleted.

2 changes: 1 addition & 1 deletion gemfiles/rails_7.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "coveralls", require: false
gem "coveralls_reborn", require: false
gem "rails", "~> 7.0"

gemspec path: "../"
2 changes: 1 addition & 1 deletion gemfiles/rails_7.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "coveralls", require: false
gem "coveralls_reborn", require: false
gem "rails", "~> 7.1"

gemspec path: "../"
4 changes: 2 additions & 2 deletions gemfiles/rails_6.0.gemfile → gemfiles/rails_7.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "coveralls", require: false
gem "rails", "6.0.6.1"
gem "coveralls_reborn", require: false
gem "rails", "~> 7.2"

gemspec path: "../"
2 changes: 1 addition & 1 deletion lib/active_record/acts_as/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module ActiveRecord
module ActsAs
VERSION = "4.0.0"
VERSION = "4.0.1"
end
end
6 changes: 5 additions & 1 deletion spec/actable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@

it "raises NoMethodError for undefined methods on specific" do
pen.save
expect{ pen.product.raise_error }.to raise_error(NoMethodError, /undefined method `non_existant_method' for #<Pen/)
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.3.0')
expect{ pen.product.raise_error }.to raise_error(NoMethodError, /undefined method `non_existant_method' for #<Pen/)
else
expect{ pen.product.raise_error }.to raise_error(NoMethodError, /undefined method `non_existant_method' for an instance of Pen/)
end
end

it "deletes specific subclass on destroy" do
Expand Down