-
Notifications
You must be signed in to change notification settings - Fork 901
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
Fix Style/MultilineTernaryOperator offenses #754
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,9 +17,7 @@ def reify(version, options) | |
unversioned_attributes: :nil | ||
) | ||
|
||
attrs = version.class.object_col_is_json? ? | ||
version.object : | ||
PaperTrail.serializer.load(version.object) | ||
attrs = version.send(:object_deserialized) | ||
|
||
# Normally a polymorphic belongs_to relationship allows us to get the | ||
# object we belong to by calling, in this case, `item`. However this | ||
|
@@ -284,9 +282,8 @@ def reify_has_many_through(transaction_id, associations, model, options = {}) | |
# table, this method would return the constant `Fruit`. | ||
def version_reification_class(version, attrs) | ||
inheritance_column_name = version.item_type.constantize.inheritance_column | ||
class_name = attrs[inheritance_column_name].blank? ? | ||
version.item_type : | ||
attrs[inheritance_column_name] | ||
class_name = attrs[inheritance_column_name] || version.item_type | ||
|
||
class_name.constantize | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do people ever set Happy to revert this change if needed. Looking through There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Seems unlikely, but we should not be changing behavior in a linter commit. If we are going to make that change, please make a separate PR. Thanks. |
||
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 know I said I'd prefer to extract private methods, but we can't do that here because we already have a problem with polluting people's AR models with a ton of methods, and I don't want to make that problem worse. See discussion in #719