Skip to content

Commit 1d0c609

Browse files
committed
include the current user's shared universes in contributable universes cache
1 parent 495aa6b commit 1d0c609

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/models/users/user.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ def contributable_universes
122122
def contributable_universe_ids
123123
# TODO: email confirmation needs to happen for data safety / privacy (only verified emails)
124124
@contributable_universe_ids ||= Contributor.where('email = ? OR user_id = ?', self.email, self.id).pluck(:universe_id)
125+
@contributable_universe_ids += Contributor.where(universe_id: my_universe_ids).pluck(:universe_id)
126+
127+
@contributable_universe_ids.uniq
125128
end
126129

127130
# TODO: rename this to #{content_type}_shared_with_me

0 commit comments

Comments
 (0)