Skip to content
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
13 changes: 3 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,13 @@ jobs:
fail-fast: false
matrix:
gemfile:
- Gemfile.rails-5.2-stable
- Gemfile.rails-6.0-stable
- Gemfile.rails-6.1-stable
- Gemfile.rails-7.0-stable
ruby-version: ['3.1', '3.0', '2.7']
- Gemfile.rails-7.2-stable
ruby-version: ['3.1', '3.0']
exclude:
- gemfile: Gemfile.rails-6.0-stable
- gemfile: Gemfile.rails-7.2-stable
ruby-version: "3.0"
- gemfile: Gemfile.rails-6.0-stable
ruby-version: "3.1"
- gemfile: Gemfile.rails-5.2-stable
ruby-version: "3.0"
- gemfile: Gemfile.rails-5.2-stable
ruby-version: "3.1"
env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gem-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up Ruby 3.0
- name: Set up Ruby 3.1
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
ruby-version: 3.1

- name: Publish to RubyGems
env:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ tmp
polymorphic_integer_type_test
gemfiles/*.lock
.idea/
.ruby-version
mysql
polymorphic_integer_type_test-*
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Changed
# Changelog

## v3.2.1 (2023-12-14)

Expand All @@ -16,4 +16,13 @@

- Fixed polymorphic_foreign_association_extension.rb to be compatible with other reflection than `has_many` and `has_one`.

### Changed
## v3.3.0 (2024-10-29)

### Changed

- Upgrade rails support version to be compatible with 7.2

### Removed

- Remove unsupported rails versions(5.0, 5.2, 6.0) and ruby version(2.7)

8 changes: 0 additions & 8 deletions gemfiles/Gemfile.rails-5.0-stable

This file was deleted.

7 changes: 0 additions & 7 deletions gemfiles/Gemfile.rails-5.2-stable

This file was deleted.

7 changes: 0 additions & 7 deletions gemfiles/Gemfile.rails-6.0-stable

This file was deleted.

1 change: 1 addition & 0 deletions gemfiles/Gemfile.rails-6.1-stable
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ source "https://rubygems.org"
gemspec path: ".."

gem "activerecord", github: "rails/rails", branch: "6-1-stable"
gem "sqlite3", "~> 1.4"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The newer version (2.x.x) is released but the older rails versions are still pin to use a lower version (~> 1.4).
Reference PR
Only the latest version (7.2.x) is able to use a higher version.

1 change: 1 addition & 0 deletions gemfiles/Gemfile.rails-7.0-stable
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ source "https://rubygems.org"
gemspec path: ".."

gem "activerecord", github: "rails/rails", branch: "7-0-stable"
gem "sqlite3", "~> 1.4"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above.

Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ source "https://rubygems.org"

gemspec path: ".."

gem "activerecord", github: "rails/rails", branch: "5-1-stable"
gem "activerecord", github: "rails/rails", branch: "7-2-stable"
2 changes: 1 addition & 1 deletion lib/polymorphic_integer_type/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module PolymorphicIntegerType
VERSION = "3.2.2"
VERSION = "3.3.0"
end
2 changes: 1 addition & 1 deletion polymorphic_integer_type.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.add_dependency "activerecord", "< 7.1"
spec.add_dependency "activerecord", "< 8"
spec.add_development_dependency "bundler"
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec"
Expand Down
2 changes: 1 addition & 1 deletion spec/polymorphic_integer_type_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
before { link }

it "should have the proper source" do
expect(source.source_links[0].source).to eql source
expect(source.reload.source_links[0].source).to eql source
end
end
end
Expand Down
14 changes: 5 additions & 9 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,14 @@
active_record_version = Gem::Version.new(ActiveRecord::VERSION::STRING)

ActiveRecord::Base.establish_connection(database_config)

if active_record_version < Gem::Version.new("5.2")
ActiveRecord::Migrator.migrate(migrations_path)
end

if active_record_version >= Gem::Version.new("5.2") && active_record_version < Gem::Version.new("6.0")
ActiveRecord::MigrationContext.new(migrations_path).migrate
end

if active_record_version >= Gem::Version.new("6.0")
if active_record_version >= Gem::Version.new("6.1") && active_record_version < Gem::Version.new("7.0")
ActiveRecord::MigrationContext.new(migrations_path, ActiveRecord::SchemaMigration).migrate
end

if active_record_version >= Gem::Version.new("7.0")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ActiveRecord::MigrationContext.new(migrations_path).migrate
end
end

config.around do |example|
Expand Down
Loading