Sha256: 7ea1cd211066063e389063f609c91a3e8428d1d215199b09567ded975c24d6fe
Contents?: true
Size: 554 Bytes
Versions: 39
Compression:
Stored size: 554 Bytes
Contents
# frozen_string_literal: true module Decidim # The form object that handles the data behind updating a user's # interests in her 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
39 entries across 39 versions & 1 rubygems