Sha256: 3eb17bc38c3b4fb05b615de3a71496bb9ec131a24f3de3396a0a4affeffea259
Contents?: true
Size: 779 Bytes
Versions: 13
Compression:
Stored size: 779 Bytes
Contents
# frozen_string_literal: true module Cmor module Legal class PrivacyPolicy < Cmor::Cms::Page after_initialize :set_defaults, if: :new_record? before_validation :set_locale_dependent_defaults, if: :new_record? default_scope { where(pathname: "/cmor/legal/", basename: "privacy_policy") } private def set_defaults self.pathname ||= "/cmor/legal/" self.basename ||= "privacy_policy" self.handler ||= "textile" self.published_at ||= Time.zone.now end def set_locale_dependent_defaults return unless self.locale.present? self.title ||= I18n.with_locale(self.locale) { I18n.t("cmor.legal.privacy_policy.default_title") } end end end end
Version data entries
13 entries across 13 versions & 1 rubygems