Fix uniq deprecation warning
DEPRECATION WARNING: uniq is deprecated and will be removed from Rails 5.1 (use distinct instead) (called from block in <class:User> at /home/travis/build/consul/consul/app/models/user.rb:67)
This commit is contained in:
@@ -64,7 +64,7 @@ class User < ActiveRecord::Base
|
|||||||
scope :active, -> { where(erased_at: nil) }
|
scope :active, -> { where(erased_at: nil) }
|
||||||
scope :erased, -> { where.not(erased_at: nil) }
|
scope :erased, -> { where.not(erased_at: nil) }
|
||||||
scope :public_for_api, -> { all }
|
scope :public_for_api, -> { all }
|
||||||
scope :by_comments, ->(query, topics_ids) { joins(:comments).where(query, topics_ids).uniq }
|
scope :by_comments, ->(query, topics_ids) { joins(:comments).where(query, topics_ids).distinct }
|
||||||
scope :by_authors, ->(author_ids) { where("users.id IN (?)", author_ids) }
|
scope :by_authors, ->(author_ids) { where("users.id IN (?)", author_ids) }
|
||||||
scope :by_username_email_or_document_number, ->(search_string) do
|
scope :by_username_email_or_document_number, ->(search_string) do
|
||||||
string = "%#{search_string}%"
|
string = "%#{search_string}%"
|
||||||
|
|||||||
Reference in New Issue
Block a user