Skip to content

Commit

Permalink
Remove unnecessary data_type_check variable (#1207)
Browse files Browse the repository at this point in the history
Remove unnecessary `data_type_check` variable and rename `data_type_check` method to `valid_data_type?`.
  • Loading branch information
gr1d99 authored and julianguyen committed Oct 27, 2018
1 parent 6faf86a commit 2087ad3
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions app/helpers/pages_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,10 @@ def valid_hash?(data_type, data)
data['link'].is_a?(String)
return false unless basic_check

data_type_check(data_type, data)
valid_data_type?(data_type, data)
end

def data_type_check(data_type, data)
if data_type == 'partners'
data_type_check = data['image_link'].is_a?(String)
elsif data_type == 'resources'
data_type_check = data['tags'].is_a?(Array) &&
data['languages'].is_a?(Array)
end
data_type_check
def valid_data_type?(data_type, data)
data['image_link'].is_a?(String) if data_type == 'partners'
end
end

0 comments on commit 2087ad3

Please sign in to comment.