From 76c4e831932bff2273c38abe1ff37cdb79164c90 Mon Sep 17 00:00:00 2001
From: Valeriy Sizov <vsv2711@gmail.com>
Date: Thu, 4 Oct 2012 13:40:40 +0300
Subject: [PATCH] Minore code-style fixes

---
 app/models/group.rb            | 2 +-
 app/models/project.rb          | 4 ++--
 app/models/user.rb             | 2 +-
 app/roles/issue_commonality.rb | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/app/models/group.rb b/app/models/group.rb
index 628d00092cdec..780d5fddca0e4 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -23,7 +23,7 @@ class Group < ActiveRecord::Base
   delegate :name, to: :owner, allow_nil: true, prefix: true
 
   def self.search query
-    where("name like :query OR code like :query", query: "%#{query}%")
+    where("name LIKE :query OR code LIKE :query", query: "%#{query}%")
   end
 
   def to_param
diff --git a/app/models/project.rb b/app/models/project.rb
index c00bb4563fd2f..982b746365d65 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -38,7 +38,7 @@ def self.active
   end
 
   def self.search query
-    where("name like :query OR code like :query OR path like :query", query: "%#{query}%")
+    where("name LIKE :query OR code LIKE :query OR path LIKE :query", query: "%#{query}%")
   end
 
   def self.create_by_user(params, user)
@@ -127,7 +127,7 @@ def commit_notes(commit)
   end
 
   def commit_line_notes(commit)
-    notes.where(noteable_id: commit.id, noteable_type: "Commit").where("line_code is not null")
+    notes.where(noteable_id: commit.id, noteable_type: "Commit").where("line_code IS NOT NULL")
   end
 
   def public?
diff --git a/app/models/user.rb b/app/models/user.rb
index bed568effdc55..cf12fd607086c 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -73,7 +73,7 @@ def self.gitlab_auth
   end
 
   def self.search query
-    where("name like :query or email like :query", query: "%#{query}%")
+    where("name LIKE :query OR email LIKE :query", query: "%#{query}%")
   end
 end
 
diff --git a/app/roles/issue_commonality.rb b/app/roles/issue_commonality.rb
index ab6f89ff0b89a..304f08fda6c09 100644
--- a/app/roles/issue_commonality.rb
+++ b/app/roles/issue_commonality.rb
@@ -19,7 +19,7 @@ module IssueCommonality
     scope :opened, where(closed: false)
     scope :closed, where(closed: true)
     scope :of_group, ->(group) { where(project_id: group.project_ids) }
-    scope :assigned, lambda { |u| where(assignee_id: u.id)}
+    scope :assigned, ->(u) { where(assignee_id: u.id)}
 
     delegate :name,
              :email,
-- 
GitLab