Skip to content

Commit 74d042b

Browse files
authored
Merge pull request #182 from kbrock/v71
Drop rails version 7.0 patch
2 parents 9080459 + edcfb62 commit 74d042b

File tree

2 files changed

+1
-45
lines changed

2 files changed

+1
-45
lines changed

activerecord-virtual_attributes.gemspec

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ Gem::Specification.new do |spec|
2828

2929
spec.require_paths = ["lib"]
3030

31-
spec.add_dependency "concurrent-ruby", "< 1.3.5" # Temporary pin down as concurrent-ruby 1.3.5 breaks Rails 7.0, and rails-core doesn't
32-
# plan to ship a new 7.0 to fix it. See https://github.com/rails/rails/pull/54264
33-
spec.add_runtime_dependency "activerecord", "~> 7.0", ">=7.0.8.7"
31+
spec.add_runtime_dependency "activerecord", "~> 7.1", ">=7.1.5.1"
3432

3533
spec.add_development_dependency "byebug"
3634
spec.add_development_dependency "database_cleaner-active_record", "~> 2.1"

lib/active_record/virtual_attributes/virtual_arel.rb

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -118,45 +118,3 @@ def define_virtual_arel(name, arel) # :nodoc:
118118
end
119119
end
120120

121-
# fixed in https://github.com/rails/rails/pull/45642
122-
if ActiveRecord.version < Gem::Version.new(7.1)
123-
module Arel # :nodoc: all
124-
# rubocop:disable Naming/MethodName
125-
# rubocop:disable Naming/MethodParameterName
126-
# rubocop:disable Style/ConditionalAssignment
127-
module Visitors
128-
# rails 6.1...
129-
class ToSql
130-
private
131-
132-
def visit_Arel_Nodes_HomogeneousIn(o, collector)
133-
collector.preparable = false
134-
135-
# change:
136-
# See https://github.com/rails/rails/pull/45642
137-
visit(o.left, collector)
138-
# /change
139-
140-
if o.type == :in
141-
collector << " IN ("
142-
else
143-
collector << " NOT IN ("
144-
end
145-
146-
values = o.casted_values
147-
148-
if values.empty?
149-
collector << @connection.quote(nil)
150-
else
151-
collector.add_binds(values, o.proc_for_binds, &bind_block)
152-
end
153-
154-
collector << ")"
155-
end
156-
end
157-
end
158-
# rubocop:enable Naming/MethodName
159-
# rubocop:enable Naming/MethodParameterName
160-
# rubocop:enable Style/ConditionalAssignment
161-
end
162-
end

0 commit comments

Comments
 (0)