Files
openfoodnetwork/app/services/terms_of_service.rb
Luis Ramos e52937c113 Use rubocop auto correct to add frozen string literal to all files
This is an unsafe auto corection, we will need to trust our build here
2021-06-17 23:07:26 +01:00

14 lines
390 B
Ruby

# frozen_string_literal: true
class TermsOfService
def self.tos_accepted?(customer, distributor = nil)
return false unless accepted_at = customer&.terms_and_conditions_accepted_at
accepted_at > if distributor
distributor.terms_and_conditions_updated_at
else
TermsOfServiceFile.updated_at
end
end
end