File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -5,28 +5,28 @@ class Commit < ApplicationRecord
5
5
6
6
scope :with_no_contributors , -> {
7
7
select ( 'commits.*' ) . # otherwise we get read-only records
8
- joins ( 'LEFT OUTER JOIN contributions ON commits.id = contributions.commit_id' ) .
9
- where ( ' contributions.commit_id' => nil )
8
+ left_joins ( : contributions) .
9
+ where ( contributions : { commit_id : nil } )
10
10
}
11
11
12
12
scope :in_time_window , -> ( since , upto ) {
13
13
if upto
14
- where ( [ 'commits. committer_date BETWEEN ? AND ?' , since , upto ] )
14
+ where ( committer_date : since .. upto )
15
15
else
16
- where ( [ 'commits.committer_date >= ?' , since ] )
16
+ where ( 'commits.committer_date >= ?' , since )
17
17
end
18
18
}
19
19
20
20
scope :release , -> ( release ) {
21
- where ( 'commits. release_id' => release . id )
21
+ where ( release_id : release . id )
22
22
}
23
23
24
24
scope :edge , -> {
25
- where ( 'commits. release_id' => nil )
25
+ where ( release_id : nil )
26
26
}
27
27
28
28
scope :sorted , -> {
29
- order ( 'commits. committer_date DESC' )
29
+ order ( committer_date : :desc )
30
30
}
31
31
32
32
validates :sha1 , presence : true , uniqueness : true
You can’t perform that action at this time.
0 commit comments