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
11 changes: 8 additions & 3 deletions .github/workflows/ruby_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -49,4 +54,4 @@ jobs:
run: bundle install --jobs 4 --retry 3

- name: Run RuboCop
run: BUNDLE_GEMFILE=${{ matrix.gemfile }} bundle exec rubocop
run: BUNDLE_GEMFILE=${{ matrix.gemfile }} bundle exec rubocop
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Metrics/BlockLength:
- 'spec/**/*.rb'
- 'activerecord-type-symbol.gemspec'

Metrics/LineLength:
Layout/LineLength:
Max: 120
Exclude:
- 'activerecord-type-symbol.gemspec'
18 changes: 9 additions & 9 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions activerecord-type-symbol.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions gemfiles/rails_7.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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: '../'
10 changes: 10 additions & 0 deletions gemfiles/rails_7.1.gemfile
Original file line number Diff line number Diff line change
@@ -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: '../'
10 changes: 10 additions & 0 deletions gemfiles/rails_7.2.gemfile
Original file line number Diff line number Diff line change
@@ -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: '../'
2 changes: 1 addition & 1 deletion lib/active_record/type/symbol.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module ActiveRecord
module Type
class Symbol < ActiveModel::Type::Value
VERSION = '0.5.0'
VERSION = '0.6.0'

def type
:symbol
Expand Down
8 changes: 4 additions & 4 deletions spec/activerecord/type/symbol_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -108,15 +108,15 @@
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)
end
end

context 'saved record' do
let(:model) { ModelWithSymbolAttributeWithDefaultValue.create }
let(:model) { ModelWithSymbolAttrWithDefaultValue.create }

specify 'returns the default value' do
model.reload
Expand All @@ -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)
Expand Down