railsadminteam / rails_admin

RailsAdmin is a Rails engine that provides an easy-to-use interface for managing your data
MIT License
7.87k stars 2.25k forks source link

Switch to the safe navigation operator in spec files #3588

Closed jdufresne closed 1 year ago

jdufresne commented 1 year ago

Ruby now has native support safe navigation so it can sometimes be used instead of the Rails Object#try method.

The change is limited to just the specs until other changes can be thoroughly verified. The safe navigation operator is different in that if the object is non-nil and the object does not respond to the method, a NoMethodError will be raised.

coveralls commented 1 year ago

Coverage Status

Coverage: 95.838% (-0.05%) from 95.887% when pulling 592c2dde278bbb0ef48f0ecc35b05bd14adb8218 on jdufresne:spec-try into fa9a96bb12f07da349c0c2884a30a4f207991e4b on railsadminteam:master.

mshibuya commented 1 year ago

👍