diff options
-rw-r--r-- | app/models/member.rb | 3 | ||||
-rw-r--r-- | app/models/user.rb | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/app/models/member.rb b/app/models/member.rb index 9d913805ad2..bcb6e32d53a 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -31,7 +31,6 @@ class Member < ActiveRecord::Base scope :non_invite, -> { where(invite_token: nil) } scope :request, -> { where.not(requested_at: nil) } scope :has_access, -> { where('access_level > 0') } - scope :still_active, -> { where('expires_at IS NULL OR expires_at > ?', Time.current) } scope :guests, -> { where(access_level: GUEST) } scope :reporters, -> { where(access_level: REPORTER) } @@ -55,7 +54,7 @@ class Member < ActiveRecord::Base class << self def access_for_user_ids(user_ids) - where(user_id: user_ids).has_access.still_active.pluck(:user_id, :access_level).to_h + where(user_id: user_ids).has_access.pluck(:user_id, :access_level).to_h end def find_by_invite_token(invite_token) diff --git a/app/models/user.rb b/app/models/user.rb index 2995db9a5f2..db747434959 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -66,7 +66,7 @@ class User < ActiveRecord::Base # Projects has_many :groups_projects, through: :groups, source: :projects has_many :personal_projects, through: :namespace, source: :projects - has_many :project_members, -> { where(requested_at: nil).still_active }, dependent: :destroy, class_name: 'ProjectMember' + has_many :project_members, -> { where(requested_at: nil) }, dependent: :destroy, class_name: 'ProjectMember' has_many :projects, through: :project_members has_many :created_projects, foreign_key: :creator_id, class_name: 'Project' has_many :users_star_projects, dependent: :destroy |