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

Fix CI #560

Merged
merged 3 commits into from Feb 16, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 14 additions & 11 deletions .github/workflows/ci.yml
Expand Up @@ -45,6 +45,8 @@ jobs:
version: '6.0'
- name: 'active_record'
version: '6.1'
- name: 'active_record'
version: '7.0'
- name: 'sequel'
version: '5'
experimental: [false]
Expand All @@ -66,7 +68,7 @@ jobs:
feature: 'rails'
orm:
name: 'active_record'
version: '6.1'
version: '7.0'
database: 'sqlite3'
experimental: false
- ruby: '3.0'
Expand All @@ -80,27 +82,27 @@ jobs:
feature: 'unit'
orm:
name: 'active_record'
version: '7.0'
version: 'edge'
experimental: true
- ruby: '3.0'
database: 'mysql'
feature: 'unit'
orm:
name: 'active_record'
version: '7.0'
version: 'edge'
experimental: true
- ruby: '3.0'
database: 'postgres'
feature: 'unit'
orm:
name: 'active_record'
version: '7.0'
version: 'edge'
experimental: true
- ruby: '2.7'
feature: 'rails'
orm:
name: 'active_record'
version: '6.1'
version: '7.0'
database: 'sqlite3'
experimental: false
- ruby: '2.7'
Expand All @@ -114,23 +116,27 @@ jobs:
feature: 'unit'
orm:
name: 'active_record'
version: '7.0'
version: 'edge'
experimental: true
- ruby: '2.7'
database: 'mysql'
feature: 'unit'
orm:
name: 'active_record'
version: '7.0'
version: 'edge'
experimental: true
- ruby: '2.7'
database: 'postgres'
feature: 'unit'
orm:
name: 'active_record'
version: '7.0'
version: 'edge'
experimental: true
exclude:
- ruby: '2.6'
orm:
name: 'active_record'
version: '7.0'
- ruby: '2.7'
orm:
name: 'active_record'
Expand Down Expand Up @@ -188,9 +194,6 @@ jobs:
- name: Install Postgres
run: sudo apt-get install libpq-dev postgresql-client -y
if: matrix.database == 'postgres'
- name: Install MySQL
run: sudo apt-get install libmysqlclient-dev mysql-client -y
if: matrix.database == 'mysql'
- id: cache-bundler
uses: actions/cache@v2
with:
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Expand Up @@ -8,11 +8,11 @@ orm, orm_version = ENV['ORM'], ENV['ORM_VERSION']
group :development, :test do
case orm
when 'active_record'
orm_version ||= '6.1'
orm_version ||= '7.0'
case orm_version
when '4.2', '5.0', '5.1', '5.2', '6.0', '6.1'
when '4.2', '5.0', '5.1', '5.2', '6.0', '6.1', '7.0'
gem 'activerecord', "~> #{orm_version}.0"
when '7.0'
when 'edge'
git 'https://github.com/rails/rails.git', branch: 'main' do
gem 'activerecord'
gem 'activesupport'
Expand Down
8 changes: 7 additions & 1 deletion lib/mobility/plugins/active_model/dirty.rb
Expand Up @@ -153,7 +153,13 @@ def #{method_name}(attr_name, *rest#{kwargs})
# suffixes is simplest given they change from Rails version to version.
def patterns
@patterns ||=
(klass.attribute_method_matchers.map { |p| "#{p.prefix}%s#{p.suffix}" } - excluded_patterns)
begin
# Method name changes in Rails 7.1
attribute_method_patterns = klass.respond_to?(:attribute_method_patterns) ?
klass.attribute_method_patterns :
klass.attribute_method_matchers
attribute_method_patterns.map { |p| "#{p.prefix}%s#{p.suffix}" } - excluded_patterns
end
end

private
Expand Down