Skip to content

Conversation

@dwelch-r7
Copy link
Contributor

@dwelch-r7 dwelch-r7 commented Mar 13, 2025

We need to specify a coder here to be compatible with Rails 7.1

Tested as part of the framework PR rails 7.1 here: rapid7/metasploit-framework#19953
Rails 7.0 here: rapid7/metasploit-framework#19977

@dwelch-r7 dwelch-r7 force-pushed the add-coder-to-mdm-payload branch 3 times, most recently from dea65af to e4cdb04 Compare March 21, 2025 13:33
@dwelch-r7 dwelch-r7 force-pushed the add-coder-to-mdm-payload branch from e4cdb04 to b5f7406 Compare March 21, 2025 15:05

class Event < ApplicationRecord
serialize :info
if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we're tab indented here for some reason, ignore the formatting it looks normal in the IDE, file was orinigally tabs so not going to change that

@dwelch-r7 dwelch-r7 force-pushed the add-coder-to-mdm-payload branch from 8458eea to cb882a2 Compare March 21, 2025 16:59
Comment on lines +96 to +100
if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
serialize :urls, coder: YAML
else
serialize :urls
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

since specifying coder: is a noop, and the old code didn't specify any coder, this if/else statementi s kind of redundant, I did add in an explicit serialize :urls, YAML but that broke the tests and it makes more sense to keep the old functionality the same as it was before
I don't mind keeping it here, since it makes it obvious what the intention is

@dwelch-r7 dwelch-r7 merged commit 844e00b into master Mar 24, 2025
15 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.

4 participants