Sha256: a14067a748e8ce573a5460289808003ad167acac0ca4d18ba35293b228e4a3bd

Contents?: true

Size: 530 Bytes

Versions: 3

Compression:

Stored size: 530 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # The form object that handles the data behind updating a user's
  # notifications settings in her profile page.
  class NotificationsSettingsForm < Form
    mimic :user

    attribute :email_on_notification
    attribute :newsletter_notifications

    validates :email_on_notification, presence: true
    validates :newsletter_notifications, presence: true

    def newsletter_notifications_at
      return nil unless newsletter_notifications
      Time.zone.now
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
decidim-core-0.13.1 app/forms/decidim/notifications_settings_form.rb
decidim-core-0.13.0 app/forms/decidim/notifications_settings_form.rb
decidim-core-0.13.0.pre1 app/forms/decidim/notifications_settings_form.rb