-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix signetures for ActiveModelSerializers
These `options` are optional positional arguments, so this commit fixes method signatures. * ActiveModel::Serializer.attribute * https://github.com/rails-api/active_model_serializers/blob/v0.10.14/lib/active_model/serializer.rb#L226 * ActiveModel::Serializer#initialize * https://github.com/rails-api/active_model_serializers/blob/v0.10.14/lib/active_model/serializer.rb#L319 * ActiveModelSerializers::SerializableResource * https://github.com/rails-api/active_model_serializers/blob/v0.10.14/lib/active_model_serializers/serializable_resource.rb#L17
- Loading branch information
Showing
3 changed files
with
10 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
module ActiveModel | ||
class Serializer[T] | ||
def self.attributes: (*Symbol attrs) -> void | ||
def self.attribute: (Symbol attr, Hash[Symbol, untyped] options) ?{ () -> untyped } -> void | ||
def self.attribute: (Symbol attr, ?Hash[Symbol, untyped] options) ?{ () -> untyped } -> void | ||
|
||
attr_accessor object: T | ||
attr_accessor root: untyped | ||
attr_accessor scope: untyped | ||
|
||
def initialize: (T object, Hash[Symbol, untyped] options) -> void | ||
def initialize: (T object, ?Hash[Symbol, untyped] options) -> void | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters