diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5d1c4ba..7f50dc4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,8 +16,27 @@ jobs: matrix: ruby-version: - 2.7 + - 3.0 + - 3.1 + - 3.2 active-record-version: - - 5.2.0 + - 6.0.0 + - 6.1.0 + - 7.0.0 + - 7.1.0 + exclude: + - ruby-version: 3.2 + active-record-version: 6.0.0 + - ruby-version: 3.2 + active-record-version: 6.1.0 + - ruby-version: 3.2 + active-record-version: 7.0.0 + - ruby-version: 3.1 + active-record-version: 6.0.0 + - ruby-version: 3.1 + active-record-version: 6.1.0 + - ruby-version: 3.0 + active-record-version: 6.0.0 env: ACTIVE_RECORD_VERSION: "${{ matrix.active-record-version }}" steps: diff --git a/.gitignore b/.gitignore index 9aa8d59..d82e0c1 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,8 @@ build/ /.bundle/ /lib/bundler/man/ +Gemfile.lock + # for a library or gem, you might want to ignore these files since the code is # intended to run in multiple environments; otherwise, check them in: # Gemfile.lock diff --git a/.ruby-version b/.ruby-version index 49cdd66..0aec50e 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7.6 +3.1.4 diff --git a/Gemfile b/Gemfile index bb44130..41793ee 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,7 @@ ar = case ar_version when "master" { github: "rails/rails" } when "default" - ">= 5.2" + ">= 6.0" else "~> #{ar_version}" end diff --git a/dev.yml b/dev.yml index 33f880f..06b7282 100644 --- a/dev.yml +++ b/dev.yml @@ -2,7 +2,7 @@ version: "2.0" setup: - ruby: 2.7.6 + ruby: 3.1.4 bundler: 2.4.21 commands: diff --git a/inheritance_integer_type.gemspec b/inheritance_integer_type.gemspec index a58ed2a..06fc8d9 100644 --- a/inheritance_integer_type.gemspec +++ b/inheritance_integer_type.gemspec @@ -22,6 +22,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency "rake" spec.add_development_dependency "rspec" spec.add_development_dependency "activerecord", ">= 5.2" - spec.add_development_dependency "sqlite3", "~> 1.3.6" + spec.add_development_dependency "sqlite3", "~> 1.4" spec.add_development_dependency "pry" end diff --git a/lib/inheritance_integer_type/extensions.rb b/lib/inheritance_integer_type/extensions.rb index 9fffb5c..afaf712 100644 --- a/lib/inheritance_integer_type/extensions.rb +++ b/lib/inheritance_integer_type/extensions.rb @@ -13,7 +13,7 @@ def find_sti_class(type_name) else begin if store_full_sti_class - ActiveSupport::Dependencies.constantize(lookup) + lookup.constantize else compute_type(lookup) end diff --git a/spec/inheritance_integer_type_spec.rb b/spec/inheritance_integer_type_spec.rb index 854882f..c09ccff 100644 --- a/spec/inheritance_integer_type_spec.rb +++ b/spec/inheritance_integer_type_spec.rb @@ -48,7 +48,7 @@ describe "Has many associations" do let(:other) { Other.create } before do - [base, left, deep].each{|a| a.update_attributes(other: other) } + [base, left, deep].each{|a| a.update_attribute(:other, other) } end subject { other } it "properly finds the classes through the association" do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 307170d..b003f0e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,7 +9,7 @@ RSpec.configure do |config| config.before(:suite) do - ActiveRecord::MigrationContext.new("#{File.dirname(__FILE__)}/support/migrations").migrate + ActiveRecord::MigrationContext.new("#{File.dirname(__FILE__)}/support/migrations", ::ActiveRecord::SchemaMigration).migrate end # No need to return the run the down migration after the test