extended_description.rb 333 B

123456789101112131415
  1. # frozen_string_literal: true
  2. class ExtendedDescription < ActiveModelSerializers::Model
  3. attributes :updated_at, :text
  4. def self.current
  5. custom = Setting.find_by(var: 'site_extended_description')
  6. if custom&.value.present?
  7. new(text: custom.value, updated_at: custom.updated_at)
  8. else
  9. new
  10. end
  11. end
  12. end