Skip to content

Commit 6b1c4ae

Browse files
yahondaclaude
andcommitted
Drop rescue nil guard for partial_updates =
The guard was added in 2008 (8f5029c, "Adapted spec tests so that they run both on Rails 2.1.0 and Rails 2.0.2") because Rails 2.0.2 did not yet have `partial_updates=`. The setter then went through two more renames in upstream Rails: - Rails ~3.x renamed `partial_updates` → `partial_writes` (the spec was tracked through 7d1a4ba here). - rails/rails#42355 (Rails 7.0) deprecated `partial_writes` in favor of `partial_updates` / `partial_inserts`. PR #2189 here flipped the spec back to `partial_updates =` and kept the `rescue nil` as a precaution while Rails was in transition. oracle-enhanced now depends on `activerecord ~> 8.2.0.alpha`. On Rails 8 `partial_writes=` has been removed entirely and `partial_updates=` is the stable public API: irb> ActiveRecord::Base.respond_to?(:partial_writes=) #=> false irb> ActiveRecord::Base.respond_to?(:partial_updates=) #=> true So the guard hides nothing useful — and a future API rename would be better surfaced as a NoMethodError than silently swallowed. Drop the guard so the assignment runs unconditionally; if the API ever goes away the spec will fail loudly instead of silently no-opping. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 9fedcdd commit 6b1c4ae

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

spec/active_record/connection_adapters/oracle_enhanced/procedures_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def raise_make_transaction_rollback
316316
end
317317

318318
it "should log update record" do
319-
(TestEmployee.partial_updates = false) rescue nil
319+
TestEmployee.partial_updates = false
320320
@employee = TestEmployee.create(
321321
first_name: "First",
322322
last_name: "Last",

0 commit comments

Comments
 (0)