Sha256: 19b9f37dc442960772d28361fcd49d899be8fb3e22084ef533ae558eed2eff9f

Contents?: true

Size: 529 Bytes

Versions: 4

Compression:

Stored size: 529 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.current
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
decidim-core-0.14.4 app/forms/decidim/notifications_settings_form.rb
decidim-core-0.14.3 app/forms/decidim/notifications_settings_form.rb
decidim-core-0.14.2 app/forms/decidim/notifications_settings_form.rb
decidim-core-0.14.1 app/forms/decidim/notifications_settings_form.rb