Removed useless code

This commit is contained in:
Alberto Miedes Garcés
2017-01-07 22:20:28 +01:00
parent a31f6be3bd
commit 3c73f35416
3 changed files with 3 additions and 13 deletions

View File

@@ -3,7 +3,6 @@ User:
id: integer
username: string
Voter:
options: [disable_filtering]
fields:
gender: string
age_range: string

View File

@@ -13,10 +13,6 @@ module GraphQL
filter_forbidden_elements(requested_elements)
end
def self.matching_exceptions
[:public_voter]
end
private
def target_public_elements
@@ -24,9 +20,7 @@ module GraphQL
end
def filter_forbidden_elements(requested_elements)
if AssociationResolver.matching_exceptions.include?(field_name)
requested_elements
elsif requested_elements.respond_to?(:each)
if requested_elements.respond_to?(:each)
requested_elements.all & allowed_elements.all
else
allowed_elements.include?(requested_elements) ? requested_elements : nil

View File

@@ -25,7 +25,7 @@ describe GraphQL::AssociationResolver do
it 'resolves simple associations' do
geozone = create(:geozone)
proposal = create(:proposal, geozone: geozone)
result = geozone_resolver.call(proposal, nil, nil)
expect(result).to eq(geozone)
@@ -54,9 +54,6 @@ describe GraphQL::AssociationResolver do
expect(result).to be_empty
end
it 'permits all elements for exceptions' do
skip 'Current implementation is temporary'
end
end
end