Add terms of service (#33055)
This commit is contained in:
parent
7a2a345c08
commit
30aa0df88c
129 changed files with 1456 additions and 238 deletions
25
app/models/terms_of_service/generator.rb
Normal file
25
app/models/terms_of_service/generator.rb
Normal file
|
@ -0,0 +1,25 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class TermsOfService::Generator
|
||||
include ActiveModel::Model
|
||||
|
||||
TEMPLATE = Rails.root.join('config', 'templates', 'terms-of-service.md').read
|
||||
|
||||
VARIABLES = %i(
|
||||
admin_email
|
||||
arbitration_address
|
||||
arbitration_website
|
||||
dmca_address
|
||||
dmca_email
|
||||
domain
|
||||
jurisdiction
|
||||
).freeze
|
||||
|
||||
attr_accessor(*VARIABLES)
|
||||
|
||||
validates(*VARIABLES, presence: true)
|
||||
|
||||
def render
|
||||
format(TEMPLATE, VARIABLES.index_with { |key| public_send(key) })
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue