diff --git a/Appraisals b/Appraisals index 09f8b70..ad66f60 100644 --- a/Appraisals +++ b/Appraisals @@ -6,6 +6,6 @@ appraise "rails-6.1" do gem "rails", "~> 6.1.0" end -appraise "rails-7.0" do - gem "rails", "~> 7.0" -end \ No newline at end of file +# appraise "rails-7.0" do +# gem "rails", "~> 7.0" +# end \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 0f32734..52e72de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.7 +FROM ruby:3.0 WORKDIR /usr/src/app diff --git a/lib/active_record/connection_adapters/mysql/column_methods.rb b/lib/active_record/connection_adapters/mysql/column_methods.rb index 97b42a6..766088f 100644 --- a/lib/active_record/connection_adapters/mysql/column_methods.rb +++ b/lib/active_record/connection_adapters/mysql/column_methods.rb @@ -5,7 +5,7 @@ module ConnectionAdapters module MySQL module ColumnMethods def enum(*args, **options) - args.each { |name| column(name, :enum, options) } + args.each { |name| column(name, :enum, **options) } end end end diff --git a/spec/active_record/column_methods_spec.rb b/spec/active_record/column_methods_spec.rb new file mode 100644 index 0000000..e36c4ed --- /dev/null +++ b/spec/active_record/column_methods_spec.rb @@ -0,0 +1,23 @@ +require 'spec_helper' + +class FakeAdapter + def self.define_column_methods(*args) + # no-op + end + + include ActiveRecord::ConnectionAdapters::MySQL::ColumnMethods +end + +module ActiveRecord + module ConnectionAdapters + module MySQL + RSpec.describe ColumnMethods do + it "correctly calls based on enum" do + instance = FakeAdapter.new + expect(instance).to receive(:column).with(:status, :enum, limit: [:active, :archived]) + instance.enum(:status, limit: [:active, :archived]) + end + end + end + end +end \ No newline at end of file