We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 68592cf commit a159deaCopy full SHA for a159dea
plugin.rb
@@ -22,6 +22,7 @@ class Engine < ::Rails::Engine
22
end
23
24
#############################################################################
25
+ # /config/routes.rb
26
27
CommunityCustomFields::Engine.routes.draw do
28
put '/:topic_id' => 'custom_fields#update'
@@ -62,4 +63,10 @@ def update
62
63
add_to_serializer(:topic_view, :custom_fields) do
64
object.topic.custom_fields.slice('assignee_id', 'status')
65
66
+
67
+ on(:topic_created) do |topic, params, user|
68
+ topic.custom_fields["assignee_id"] ||= nil # or any default value
69
+ topic.custom_fields["status"] ||= "new"
70
+ topic.save_custom_fields
71
+ end
72
0 commit comments