DEV: Ensure topic_list custom field preloading persists in development (#324)
This was causing an error on topic lists after a zeitwerk reload. Using the official plugin API takes care of reloading correctly.
This commit is contained in:
		
							parent
							
								
									a7ca28e5fc
								
							
						
					
					
						commit
						139fdd9cc3
					
				| 
						 | 
				
			
			@ -251,7 +251,7 @@ after_initialize do
 | 
			
		|||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  TopicList.preloaded_custom_fields << DiscoursePostEvent::TOPIC_POST_EVENT_STARTS_AT
 | 
			
		||||
  add_preloaded_topic_list_custom_field DiscoursePostEvent::TOPIC_POST_EVENT_STARTS_AT
 | 
			
		||||
 | 
			
		||||
  add_to_serializer(:topic_view, :event_starts_at, false) do
 | 
			
		||||
    object.topic.custom_fields[DiscoursePostEvent::TOPIC_POST_EVENT_STARTS_AT]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue