Class: Decidim::UpdateUserInterests
- Defined in:
- decidim-core/app/commands/decidim/update_user_interests.rb
Overview
This command updates the user’s interests.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(user, form) ⇒ UpdateUserInterests
constructor
Updates a user’s intersts.
Methods inherited from Command
call, #evaluate, #method_missing, #respond_to_missing?, #transaction, #with_events
Constructor Details
#initialize(user, form) ⇒ UpdateUserInterests
Updates a user’s intersts.
user - The user to be updated. form - The form with the data.
10 11 12 13 |
# File 'decidim-core/app/commands/decidim/update_user_interests.rb', line 10 def initialize(user, form) @user = user @form = form end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Decidim::Command
Instance Method Details
#call ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'decidim-core/app/commands/decidim/update_user_interests.rb', line 15 def call return broadcast(:invalid) unless @form.valid? update_interests @user.save! broadcast(:ok) end |