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

Support Rails 7.2 #144

Merged
merged 2 commits into from
Aug 31, 2024
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
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ jobs:
- ruby-version: "3.2"
gemfile: Gemfile.rails-7-1
experimental: false
- ruby-version: "3.2"
- ruby-version: "3.3"
gemfile: Gemfile.rails-7-2
experimental: false
- ruby-version: "3.3"
gemfile: Gemfile.rails-main
experimental: true

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eval_gemfile "#{__dir__}/Gemfile.rails-5-2"
eval_gemfile "#{__dir__}/Gemfile.rails-7-2"
5 changes: 5 additions & 0 deletions Gemfile.rails-7-2
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
group :development, :test do
gem 'rails', '~> 7.2.0'
end

eval_gemfile "#{__dir__}/Gemfile.base"
2 changes: 1 addition & 1 deletion active_record_upsert.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ Gem::Specification.new do |spec|

spec.platform = Gem::Platform::RUBY

spec.add_runtime_dependency 'activerecord', '>= 5.2', '< 7.2'
spec.add_runtime_dependency 'activerecord', '>= 5.2', '< 8.0'
spec.add_runtime_dependency 'pg', '>= 0.18', '< 2.0'
end
7 changes: 5 additions & 2 deletions lib/active_record_upsert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@

version = defined?(Rails) ? Rails.version : ActiveRecord.version.to_s

require 'active_record_upsert/compatibility/rails70.rb' if version >= '7.0.0' && version < '7.2.0'
require 'active_record_upsert/compatibility/rails60.rb' if version >= '6.0.0' && version < '6.2.0'
if version >= '7.0.0'
require 'active_record_upsert/compatibility/rails70.rb'
elsif version >= '6.0.0' && version < '6.2.0'
require 'active_record_upsert/compatibility/rails60.rb'
end

module ActiveRecordUpsert
# Your code goes here...
Expand Down
Loading