Tag: where-clause
-
undefined method `ids’ for [#
0 def resolve(where: {}, order_by: {‘field’: ‘updated_at’, ‘direction’: ‘desc’}) order_by.symbolize_keys! [context[:current_user]] unless context[:current_user].has_capability?(self.class.name.demodulize) cap_belongs_to = context[:current_user].determine_capability_belongs_to(self.class.name.demodulize) users = if cap_belongs_to[:direct] || context[:current_user].user_type == ‘SuperAdmin’ context[:tenant].users.includes([:groups, :roles]).where(where).order("#{order_by[:field]} #{order_by[:direction]}") elsif cap_belongs_to[:group].present? context[:tenant].groups.where(cap_belongs_to[‘group’]).map(&:users).flatten else [context[:current_user]] end stored_user_contents = (UserContent.select("DISTINCT ON (user_id) user_contents.*")) users.to_a missing_user_content_ids = users.ids – stored_user_contents.pluck(:user_id) missing_user_contents = missing_user_content_ids.map do |user_id| UserContent.new(user_id: user_id, on_fly: true) end…