Where can I view the use of PluginStoreRow?


(Evgeny) #1

I do not want to touch the main tables in the Discourse database.

Interestingly, there are examples of using PluginStorRov that would add the necessary information. In my case, I want to add information to the topics. This is equivalent if you add a column to the topic table.


(Sam Saffron) #2

In general we would use topic custom fields for that particular case as it fits nicer into the system.


(Evgeny) #3

You mean something like that?

   Topic.register_custom_field_type('topic_info', :text)
   add_to_serializer(:topic_view, :custom_fields, false) {object.topic.custom_fields}

(Sam Saffron) #4

similar I would look at the source code for discourse-assign for a working example.


Adding Custom field to Topics