Skip to content

Conversation

@nathan-salazar
Copy link
Contributor

@nathan-salazar nathan-salazar commented Oct 8, 2025

Why?

Resolves LCM-1051

In Rails 7.1 they removed an override of the === operator (specifically, this was removed in 7.1). This ultimately affects the way case statements work.

Now that we have introduced SeismicUser and SeismicGroup in the core app, the case statement is failing. Explicitly using the is_a? method not only makes this more clear, but also preserves the original logic.

What?

Changes the case statement (which implicitly relies on ===) to an if/else that uses the is_a? method.

Further Reading

Merge Instructions

Please DO squash my commits when merging

when ActiveRecord::Base
actor

if actor.is_a?(ActiveRecord::Base)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/GuardClause: Use a guard clause instead of wrapping the code inside a conditional expression.

matrix:
os: [ubuntu-latest]
ruby: ["2.6", "2.7", "3.0"]
ruby: ["2.7", "3.0", "3.1", "3.2"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruby 2.6 tests were failing due to an incompatibility with ActiveSupport 6.1. Plus, its EOL was in 2022 so I figured we're safe to stop supporting it.

Copy link
Member

@wernull wernull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good

@nathan-salazar nathan-salazar merged commit 03cff4c into master Oct 8, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants