Commit 76c4e831932bff2273c38abe1ff37cdb79164c90

Authored by Valeriy Sizov
1 parent 810d0903

Minore code-style fixes

app/models/group.rb
... ... @@ -23,7 +23,7 @@ class Group < ActiveRecord::Base
23 23 delegate :name, to: :owner, allow_nil: true, prefix: true
24 24  
25 25 def self.search query
26   - where("name like :query OR code like :query", query: "%#{query}%")
  26 + where("name LIKE :query OR code LIKE :query", query: "%#{query}%")
27 27 end
28 28  
29 29 def to_param
... ...
app/models/project.rb
... ... @@ -38,7 +38,7 @@ class Project < ActiveRecord::Base
38 38 end
39 39  
40 40 def self.search query
41   - where("name like :query OR code like :query OR path like :query", query: "%#{query}%")
  41 + where("name LIKE :query OR code LIKE :query OR path LIKE :query", query: "%#{query}%")
42 42 end
43 43  
44 44 def self.create_by_user(params, user)
... ... @@ -127,7 +127,7 @@ class Project < ActiveRecord::Base
127 127 end
128 128  
129 129 def commit_line_notes(commit)
130   - notes.where(noteable_id: commit.id, noteable_type: "Commit").where("line_code is not null")
  130 + notes.where(noteable_id: commit.id, noteable_type: "Commit").where("line_code IS NOT NULL")
131 131 end
132 132  
133 133 def public?
... ...
app/models/user.rb
... ... @@ -73,7 +73,7 @@ class User < ActiveRecord::Base
73 73 end
74 74  
75 75 def self.search query
76   - where("name like :query or email like :query", query: "%#{query}%")
  76 + where("name LIKE :query OR email LIKE :query", query: "%#{query}%")
77 77 end
78 78 end
79 79  
... ...
app/roles/issue_commonality.rb
... ... @@ -19,7 +19,7 @@ module IssueCommonality
19 19 scope :opened, where(closed: false)
20 20 scope :closed, where(closed: true)
21 21 scope :of_group, ->(group) { where(project_id: group.project_ids) }
22   - scope :assigned, lambda { |u| where(assignee_id: u.id)}
  22 + scope :assigned, ->(u) { where(assignee_id: u.id)}
23 23  
24 24 delegate :name,
25 25 :email,
... ...