Allow fast checkout without re-accepting old terms

We did that for the shop's terms already and now do it for the platform
terms as well.
This commit is contained in:
Maikel Linke
2021-04-23 15:35:16 +10:00
parent 17a3d23d68
commit af314cbbdf
6 changed files with 65 additions and 2 deletions

View File

@@ -13,4 +13,10 @@ class TermsOfServiceFile < ApplicationRecord
def self.current_url
current&.attachment&.url || Spree::Config.footer_tos_url
end
# If no file has been uploaded, we don't know when the old terms have
# been updated last. So we return the most recent possible update time.
def self.updated_at
current&.updated_at || Time.zone.now
end
end