From 1ebc5fb8baefb7ba67c6580bfe05b553a78b7fc5 Mon Sep 17 00:00:00 2001 From: Laust Rud Jacobsen Date: Wed, 4 Nov 2015 22:41:51 +0100 Subject: [PATCH] App: fix lambda syntax --- app/models/app.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/app.rb b/app/models/app.rb index 801c426..21f832e 100644 --- a/app/models/app.rb +++ b/app/models/app.rb @@ -53,9 +53,9 @@ class App reject_if: proc { |attrs| !NotificationService.subclasses.map(&:to_s).include?(attrs[:type].to_s) } accepts_nested_attributes_for :notice_fingerprinter - scope :watched_by, ->(user) do + scope :watched_by, lambda { |user| where watchers: { "$elemMatch" => { "user_id" => user.id } } - end + } def watched_by?(user) watchers.pluck("user_id").include? user.id -- libgit2 0.21.2