-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add robustness to ActiveSnapshot::Config #54
Add robustness to ActiveSnapshot::Config #54
Conversation
…ility, and robustness Changes include: - Introduced constants for storage methods - Added a custom error class for invalid storage method errors - Refactored predicate methods to reduce code duplication - Enhanced error messages for invalid storage methods
I've reviewed this. The only piece of this PR that I am in favor of is: the use of constants for the storage methods. |
module ActiveSnapshot | ||
class Config | ||
class InvalidStorageMethodError < StandardError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error occurs at boot time rather than runtime. So I do not think that we need a specific error class for this.
|
||
SERIALIZED_YAML = 'serialized_yaml' | ||
SERIALIZED_JSON = 'serialized_json' | ||
NATIVE_JSON = 'native_json' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These constants would need to be frozen too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private | ||
|
||
def storage_method?(method) | ||
storage_method == method | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think this was needed. It was very simple in the first place, I would say this is overuse of private methods.
Im closing this PR as I am rejecting most of the suggested changes. Please open a new PR if you want to add the constants for the storage methods. |
Thx for feedback |
Added: Improved ActiveSnapshot::Config for better clarity, maintainability, and robustness
Changes include: