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
Update active_model_serializers 0.9.7 to 0.10.10 #8154
base: develop
Are you sure you want to change the base?
Conversation
72ca1bf
to
283a746
Compare
some pointers rails-api/active_model_serializers#2028 |
283a746
to
f725a63
Compare
@@ -82,6 +82,6 @@ def pick_serializer_class | |||
# NOTE: this matcher uses knowledge of AMS internals | |||
RSpec::Matchers.define :serialize_each_with do |expected| | |||
match do |actual| | |||
actual.is_a?(ActiveModel::ArraySerializer) && actual.instance_variable_get("@each_serializer") == expected | |||
actual.is_a?(ActiveModelSerializers::SerializableResource) && actual.instance_variable_get("@each_serializer") == expected |
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.
Layout/LineLength: Line is too long. [126/120]
f725a63
to
b2857ee
Compare
@@ -0,0 +1,166 @@ | |||
module AMS |
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.
Style/FrozenStringLiteralComment: Missing frozen string literal comment.
module AMS | ||
module V09 | ||
class Serializer < ActiveModel::Serializer | ||
|
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.
Layout/EmptyLinesAroundClassBody: Extra empty line detected at class body beginning.
module V09 | ||
class Serializer < ActiveModel::Serializer | ||
|
||
def serializable_hash(adapter_options = nil, |
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.
- Layout/IndentationWidth: Use 2 (not 3) spaces for indentation.
- Layout/SpaceAroundEqualsInParameterDefault: Surrounding space detected in default value assignment.
class Serializer < ActiveModel::Serializer | ||
|
||
def serializable_hash(adapter_options = nil, | ||
options = {}, |
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.
Layout/SpaceAroundEqualsInParameterDefault: Surrounding space detected in default value assignment.
|
||
def serializable_hash(adapter_options = nil, | ||
options = {}, | ||
adapter_instance = self.class.serialization_adapter_instance) |
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.
Layout/SpaceAroundEqualsInParameterDefault: Surrounding space detected in default value assignment.
@included[json_key] ||= [] | ||
|
||
if serializer.respond_to?(:each) | ||
serializer.each { |s| process_relationship(s, key) } |
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.
Layout/SpaceInsideBlockBraces: Space between { and | detected.
serializer.each { |s| process_relationship(s, key) } | ||
return | ||
end | ||
return unless serializer && serializer.object |
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.
Style/SafeNavigation: Use safe navigation (&.
) instead of checking if an object exists before calling the method.
end | ||
|
||
def meta_key | ||
instance_options.fetch(:meta_key, 'meta'.freeze) |
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.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
def meta_key | ||
instance_options.fetch(:meta_key, 'meta'.freeze) | ||
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.
Layout/EmptyLinesAroundClassBody: Extra empty line detected at class body end.
end | ||
|
||
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.
Layout/EmptyLinesAroundModuleBody: Extra empty line detected at module body end.
Could you please run tests and code style checks on your machine before pushing? Having the code review bot spam the same comments over and over again frequently ends in the bot being temporarily disabled, and that's quite annoying to deal with. :) |
Not sure what the benefit of upgrading here is while not porting the code but using a compat layer. A proper port is welcome. |
Changelog https://github.com/rails-api/active_model_serializers/blob/master/CHANGELOG-0-10.md