Skip to content

Commit

Permalink
fix remaining
Browse files Browse the repository at this point in the history
  • Loading branch information
nimmolo committed Jan 3, 2025
1 parent baaa258 commit c03870f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/models/observation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ def self.refresh_content_filter_caches(dry_run: false)
def self.refresh_cached_column(type: nil, foreign: nil, local: foreign,
dry_run: false)
tbl = type.camelize.constantize.arel_table
query = Observation.joins(type.to_sym).
query = Observation.unscoped.joins(type.to_sym).
where(Observation[local.to_sym].not_eq(tbl[foreign.to_sym]))
msgs = query.map do |obs|
"Fixing #{type} #{foreign} for obs ##{obs.id}, " \
Expand All @@ -778,7 +778,7 @@ def self.refresh_cached_column(type: nil, foreign: nil, local: foreign,
# date. Fixes and returns a messages for each one that was wrong.
# Used by refresh_caches script
def self.make_sure_no_observations_are_misspelled(dry_run: false)
query = Observation.joins(:name).
query = Observation.unscoped.joins(:name).
where(Name[:correct_spelling_id].not_eq(nil))
msgs = query.pluck(Observation[:id], Name[:text_name]).
map do |id, search_name|
Expand Down
4 changes: 2 additions & 2 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -578,12 +578,12 @@ def in_group?(group)

# Return an Array of Project's that this User is an admin for.
def projects_admin
Project.joins(:admin_group_users).where(user_id: id)
Project.unscoped.joins(:admin_group_users).where(user_id: id)
end

# Return an Array of Project's that this User is a member of.
def projects_member(order: :created_at, include: nil)
@projects_member ||= Project.where(user_group: user_groups.ids).
@projects_member ||= Project.unscoped.where(user_group: user_groups.ids).
includes(include).order(order).to_a
end

Expand Down

0 comments on commit c03870f

Please sign in to comment.