File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -180,15 +180,24 @@ def cache_linkable_content_for_each_content_type
180180 # so all we need to grab is additional pages in contributable universes
181181 @linkables_raw [ page_type ] = @current_user_content [ page_type ]
182182
183- if !@universe_scope && @contributable_universe_ids . any?
183+ # Add contributor content
184+ if @contributable_universe_ids . any?
184185 existing_page_ids = @linkables_raw [ page_type ] . map ( &:id )
185186
186187 pages_to_add = if page_type == Universe . name
187188 page_type . constantize . where ( id : @contributable_universe_ids )
188189 . where . not ( id : existing_page_ids )
190+ . where . not ( user_id : current_user . id )
189191 else
190192 page_type . constantize . where ( universe_id : @contributable_universe_ids )
191193 . where . not ( id : existing_page_ids )
194+ . where . not ( user_id : current_user . id )
195+ end
196+
197+ # If we're scoped to a universe, also scope contributor content pulled to that
198+ # universe. If we're not, leave it as all contributor content.
199+ if @universe_scope && pages_to_add . klass . respond_to? ( :universe )
200+ pages_to_add = pages_to_add . where ( universe : @universe_scope )
192201 end
193202
194203 filtered_fields = ContentPage . polymorphic_content_fields . map ( &:to_s )
You can’t perform that action at this time.
0 commit comments