Fix all Layout/SpaceInLambdaLiteral rubocop issues and remove files from rubocop_todo list

This commit is contained in:
Bertocq
2017-06-26 18:05:14 +02:00
parent f6fe9cc7d2
commit c4d90691b1
8 changed files with 14 additions and 25 deletions

View File

@@ -42,7 +42,7 @@ module GraphQL
field(field_name, SCALAR_TYPES[field_type], model.human_attribute_name(field_name))
when :singular_association
field(field_name, -> { created_types[field_type] }) do
resolve -> (object, arguments, context) do
resolve ->(object, arguments, context) do
association_target = object.send(field_name)
association_target.present? ? field_type.public_for_api.find_by(id: association_target.id) : nil
end
@@ -50,7 +50,7 @@ module GraphQL
when :multiple_association
field_type = field_type.first
connection(field_name, -> { created_types[field_type].connection_type }, max_page_size: 50, complexity: 1000) do
resolve -> (object, arguments, context) { object.send(field_name).public_for_api }
resolve ->(object, arguments, context) { object.send(field_name).public_for_api }
end
end
end

View File

@@ -14,13 +14,13 @@ module GraphQL
type created_type
description model.graphql_field_description
argument :id, !types.ID
resolve -> (object, arguments, context) { model.public_for_api.find_by(id: arguments['id'])}
resolve ->(object, arguments, context) { model.public_for_api.find_by(id: arguments['id'])}
end
end
connection(model.graphql_pluralized_field_name, created_type.connection_type, max_page_size: 50, complexity: 1000) do
description model.graphql_pluralized_field_description
resolve -> (object, arguments, context) { model.public_for_api }
resolve ->(object, arguments, context) { model.public_for_api }
end
end