Remove functionality related to votes demographic info
Since this was giving me too much pain and nobody actually requested this functionality, I decided to remove it.
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
class AgeRangeCalculator
|
||||
|
||||
MIN_AGE = 16
|
||||
MAX_AGE = 1.0/0.0 # Infinity
|
||||
RANGES = [ (MIN_AGE..25), (26..40), (41..60), (61..MAX_AGE) ]
|
||||
|
||||
def self.range_from_birthday(dob)
|
||||
# Inspired by: http://stackoverflow.com/questions/819263/get-persons-age-in-ruby/2357790#2357790
|
||||
now = Time.current.to_date
|
||||
age = now.year - dob.year - ((now.month > dob.month || (now.month == dob.month && now.day >= dob.day)) ? 0 : 1)
|
||||
|
||||
index = RANGES.find_index { |range| range.include?(age) }
|
||||
index ? RANGES[index] : nil
|
||||
end
|
||||
end
|
||||
@@ -69,7 +69,6 @@ module GraphQL
|
||||
|
||||
file.each do |api_type_model, api_type_info|
|
||||
model = api_type_model.constantize
|
||||
options = api_type_info['options']
|
||||
fields = {}
|
||||
|
||||
api_type_info['fields'].each do |field_name, field_type|
|
||||
@@ -82,7 +81,7 @@ module GraphQL
|
||||
end
|
||||
end
|
||||
|
||||
api_type_definitions[model] = { options: options, fields: fields }
|
||||
api_type_definitions[model] = { fields: fields }
|
||||
end
|
||||
|
||||
api_type_definitions
|
||||
|
||||
Reference in New Issue
Block a user