internetee-registry/db/data/20201007104651_make_whois_disclamer_i18ned.rb
2020-10-07 17:10:22 +05:00

21 lines
1.2 KiB
Ruby

class MakeWhoisDisclamerI18ned < ActiveRecord::Migration[6.0]
def up
entry = SettingEntry.find_by(code: 'registry_whois_disclaimer')
hash = { en: 'Search results may not be used for commercial, advertising, recompilation, repackaging, redistribution, reuse, obscuring or other similar activities.',
et: 'Otsitulemusi ei tohi kasutada ärilistel, reklaami, ümber töötlemise, edasi levitamise, taaskasutuse, muutmise ega muul sarnasel eesmärgil.',
ru: 'Результаты поиска не могут быть использованы в коммерческих целях, включая, но не ограничиваясь, рекламу, рекомпиляцию, изменение формата, перераспределение либо переиспользование.' }
string = JSON.generate(hash)
entry.format = 'hash'
entry.value = string
entry.save!
end
def down
entry = SettingEntry.find_by(code: 'registry_whois_disclaimer')
string = 'Search results may not be used for commercial, advertising, recompilation, \
repackaging, redistribution, reuse, obscuring or other similar activities.'
entry.format = 'string'
entry.value = string
entry.save!
end
end