Include self in watcher list
This commit is contained in:
@@ -2,7 +2,7 @@ class Bubbles::WatchesController < ApplicationController
|
||||
include BubbleScoped, BucketScoped
|
||||
|
||||
def show
|
||||
@watchers = @bubble.watchers_and_subscribers.without(Current.user)
|
||||
@watchers = @bubble.watchers_and_subscribers.sorted_with_user_first(Current.user)
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
+2
-1
@@ -27,7 +27,8 @@ class User < ApplicationRecord
|
||||
|
||||
after_create_commit :grant_access_to_buckets
|
||||
|
||||
scope :alphabetically, -> { order("LOWER(name)") }
|
||||
scope :alphabetically, -> { order("lower(name)") }
|
||||
scope :sorted_with_user_first, ->(user) { order(Arel.sql("id != ?, lower(name)", user.id)) }
|
||||
|
||||
def initials
|
||||
name.to_s.scan(/\b\p{L}/).join.upcase
|
||||
|
||||
Reference in New Issue
Block a user