diff --git a/.github/workflows/ruby_ci.yml b/.github/workflows/ruby_ci.yml index 1116a6a..bc1162f 100644 --- a/.github/workflows/ruby_ci.yml +++ b/.github/workflows/ruby_ci.yml @@ -13,8 +13,13 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['2.7.5', '3.0.3', '3.1.0'] - gemfile: ['gemfiles/rails_6.0.gemfile', 'gemfiles/rails_6.1.gemfile', 'gemfiles/rails_7.0.gemfile'] + ruby-version: ['2.7.8', '3.0.7', '3.1.7'] + gemfile: ['gemfiles/rails_7.0.gemfile', 'gemfiles/rails_7.1.gemfile', 'gemfiles/rails_7.2.gemfile'] + exclude: + - ruby-version: '2.7.8' + gemfile: 'gemfiles/rails_7.2.gemfile' + - ruby-version: '3.0.7' + gemfile: 'gemfiles/rails_7.2.gemfile' steps: - name: Checkout code @@ -49,4 +54,4 @@ jobs: run: bundle install --jobs 4 --retry 3 - name: Run RuboCop - run: BUNDLE_GEMFILE=${{ matrix.gemfile }} bundle exec rubocop \ No newline at end of file + run: BUNDLE_GEMFILE=${{ matrix.gemfile }} bundle exec rubocop diff --git a/.rubocop.yml b/.rubocop.yml index 33d9610..e5ca953 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -25,7 +25,7 @@ Metrics/BlockLength: - 'spec/**/*.rb' - 'activerecord-type-symbol.gemspec' -Metrics/LineLength: +Layout/LineLength: Max: 120 Exclude: - 'activerecord-type-symbol.gemspec' diff --git a/Appraisals b/Appraisals index db10739..2818706 100644 --- a/Appraisals +++ b/Appraisals @@ -1,16 +1,16 @@ # frozen_string_literal: true -appraise 'rails-6.0' do - gem 'activemodel', '6.0.3.3' - gem 'activerecord', '6.0.3.3' +appraise 'rails-7.0' do + gem 'activemodel', '~> 7.0.8' + gem 'activerecord', '~> 7.0.8' end -appraise 'rails-6.1' do - gem 'activemodel', '6.1.0' - gem 'activerecord', '6.1.0' +appraise 'rails-7.1' do + gem 'activemodel', '~> 7.1.5' + gem 'activerecord', '~> 7.1.5' end -appraise 'rails-7.0' do - gem 'activemodel', '7.0.1' - gem 'activerecord', '7.0.1' +appraise 'rails-7.2' do + gem 'activemodel', '~> 7.2.2' + gem 'activerecord', '~> 7.2.2' end diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ca098e..f6f4da5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.6.0 +- Support rails 7.1 and 7.2 +- Drop support rails < 7.0 + ## 0.5.0 - Support rails 7.0 and ruby 3.1 - Drop support rails < 6.0 diff --git a/activerecord-type-symbol.gemspec b/activerecord-type-symbol.gemspec index e7bf4e3..0c071e8 100644 --- a/activerecord-type-symbol.gemspec +++ b/activerecord-type-symbol.gemspec @@ -29,8 +29,8 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 2.7' - spec.add_dependency 'activemodel', '>= 5.0', '< 7.1' - spec.add_dependency 'activerecord', '>= 5.0', '< 7.1' + spec.add_dependency 'activemodel', '>= 7.0', '< 8.0' + spec.add_dependency 'activerecord', '>= 7.0', '< 8.0' spec.add_development_dependency 'appraisal' spec.add_development_dependency 'bundler', '>= 1.3.0' diff --git a/gemfiles/rails_7.0.gemfile b/gemfiles/rails_7.0.gemfile index 6007a7b..a2e8a4e 100644 --- a/gemfiles/rails_7.0.gemfile +++ b/gemfiles/rails_7.0.gemfile @@ -4,7 +4,7 @@ source 'https://rubygems.org' -gem 'activemodel', '7.0.1' -gem 'activerecord', '7.0.1' +gem 'activemodel', '~> 7.0.8' +gem 'activerecord', '~> 7.0.8' gemspec path: '../' diff --git a/gemfiles/rails_7.1.gemfile b/gemfiles/rails_7.1.gemfile new file mode 100644 index 0000000..f7ae473 --- /dev/null +++ b/gemfiles/rails_7.1.gemfile @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +# This file was generated by Appraisal + +source 'https://rubygems.org' + +gem 'activemodel', '~> 7.1.5' +gem 'activerecord', '~> 7.1.5' + +gemspec path: '../' diff --git a/gemfiles/rails_7.2.gemfile b/gemfiles/rails_7.2.gemfile new file mode 100644 index 0000000..3425e1d --- /dev/null +++ b/gemfiles/rails_7.2.gemfile @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +# This file was generated by Appraisal + +source 'https://rubygems.org' + +gem 'activemodel', '~> 7.2.2' +gem 'activerecord', '~> 7.2.2' + +gemspec path: '../' diff --git a/lib/active_record/type/symbol.rb b/lib/active_record/type/symbol.rb index a27eab9..e6c2954 100644 --- a/lib/active_record/type/symbol.rb +++ b/lib/active_record/type/symbol.rb @@ -3,7 +3,7 @@ module ActiveRecord module Type class Symbol < ActiveModel::Type::Value - VERSION = '0.5.0' + VERSION = '0.6.0' def type :symbol diff --git a/spec/activerecord/type/symbol_spec.rb b/spec/activerecord/type/symbol_spec.rb index 14abac5..ec73197 100644 --- a/spec/activerecord/type/symbol_spec.rb +++ b/spec/activerecord/type/symbol_spec.rb @@ -97,7 +97,7 @@ end context 'default value' do - with_model :ModelWithSymbolAttributeWithDefaultValue do + with_model :ModelWithSymbolAttrWithDefaultValue do table do |t| t.string :data_type end @@ -108,7 +108,7 @@ end context 'new record' do - let(:model) { ModelWithSymbolAttributeWithDefaultValue.new } + let(:model) { ModelWithSymbolAttrWithDefaultValue.new } specify 'returns the default value' do expect(model.data_type).to eq(:string) @@ -116,7 +116,7 @@ end context 'saved record' do - let(:model) { ModelWithSymbolAttributeWithDefaultValue.create } + let(:model) { ModelWithSymbolAttrWithDefaultValue.create } specify 'returns the default value' do model.reload @@ -125,7 +125,7 @@ end context 'saved record with nil in the database' do - let(:model) { ModelWithSymbolAttributeWithDefaultValue.create } + let(:model) { ModelWithSymbolAttrWithDefaultValue.create } specify 'returns nil' do model.update(data_type: nil)