Class: Decidim::UserInterestsForm

Inherits:
Form
  • Object
show all
Defined in:
app/forms/decidim/user_interests_form.rb

Overview

The form object that handles the data behind updating a user’s interests in her profile page.

Instance Method Summary collapse

Instance Method Details

#map_model(user) ⇒ Object



17
18
19
20
21
# File 'app/forms/decidim/user_interests_form.rb', line 17

def map_model(user)
  self.scopes = user.organization.scopes.top_level.map do |scope|
    UserInterestScopeForm.from_model(scope: scope, user: user)
  end
end

#newsletter_notifications_atObject



11
12
13
14
15
# File 'app/forms/decidim/user_interests_form.rb', line 11

def newsletter_notifications_at
  return nil unless newsletter_notifications

  Time.current
end