Sha256: 71fe9da3b58352a7890fe4330aa6f02f35edefdd953debc1a2a84e4da30e595f
Contents?: true
Size: 556 Bytes
Versions: 12
Compression:
Stored size: 556 Bytes
Contents
# frozen_string_literal: true module Decidim # The form object that handles the data behind updating a user's # interests in their profile page. class UserInterestsForm < Form mimic :user attribute :scopes, Array[UserInterestScopeForm] def newsletter_notifications_at return nil unless newsletter_notifications Time.current end def map_model(user) self.scopes = user.organization.scopes.top_level.map do |scope| UserInterestScopeForm.from_model(scope: scope, user: user) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems