Project

General

Profile

Patch #32911 » unscoped.patch

Pavel Rosický, 2020-01-28 23:34

View differences:

app/models/user.rb (working copy)
Project.unscoped do
return @project_ids_by_role if @project_ids_by_role
group_class = anonymous? ? GroupAnonymous : GroupNonMember
group_class = anonymous? ? GroupAnonymous.unscoped : GroupNonMember.unscoped
group_id = group_class.pluck(:id).first
members = Member.joins(:project, :member_roles).
......
def validate_anonymous_uniqueness
# There should be only one AnonymousUser in the database
errors.add :base, 'An anonymous user already exists.' if AnonymousUser.exists?
errors.add :base, 'An anonymous user already exists.' if AnonymousUser.unscoped.exists?
end
def available_custom_fields
lib/redmine/acts/positioned.rb (working copy)
h[column] = yield(column)
h
end
self.class.where(condition_hash)
self.class.unscoped.where(condition_hash)
end
def set_default_position
    (1-1/1)