Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/controllers/rest/history_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ class HistoryController < Rest::ApplicationController
{'id' => "#{organizational_unit_id}/#{repository_id}",
'revision' => params[:revision],
'path' => params[:path],
'limit' => params[:limit] && params[:limit].to_i,
'skip' => params[:skip] && params[:skip].to_i,
'limit' => params[:limit]&.to_i,
'skip' => params[:skip]&.to_i,
'skipMerges' => ![nil, '', '0', 'false'].
include?(params[:skipMerges]),
'before' => params[:before] && params[:before].to_i,
'after' => params[:after] && params[:after].to_i}
'before' => params[:before]&.to_i,
'after' => params[:after]&.to_i}
end
query <<-QUERY
query ($id: ID!, $revision: String, $limit: Int, $skip: Int, $skipMerges: Boolean, $before: Time, $after: Time) {
Expand Down
2 changes: 1 addition & 1 deletion app/models/multi_blob.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def valid?
prefix = "files/#{index}/"

if file[:path].blank?
field = file[:action].to_s.match?(/\Arename/) ? 'new_path' : 'path'
field = file[:action].to_s.start_with?('Arename') ? 'new_path' : 'path'
@errors.add("#{prefix}#{field}", 'must be present')
end

Expand Down
2 changes: 1 addition & 1 deletion lib/refs_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def analyze(_ref, before, after)
unsafe_range: true,
only_commit_sha: true,
limit: nil}
git.log(log_options).reverse.each do |commit_sha|
git.log(log_options).reverse_each do |commit_sha|
process_new_commit(commit_sha)
ProcessCommitJob.perform_later(repository.pk, commit_sha)
end
Expand Down
1 change: 0 additions & 1 deletion lib/tasks/apidoc.rake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

require 'fileutils'
namespace :apidoc do
# rubocop:enable Metrics/BlockLength
APIDOC_DIR = Rails.root.join('apidoc').to_s

desc <<~DESC.tr("\n", ' ')
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/importing_documents_reanalyzer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
let(:file_version_creator) do
lambda do |path = nil|
options = {repository: repository,
files: [{path: path ? path : generate(:filepath),
files: [{path: path || generate(:filepath),
content: generate(:content),
encoding: 'plain',
action: path ? 'update' : 'create'}]}
Expand Down
2 changes: 1 addition & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require File.expand_path('../../config/environment', __dir__)
# Prevent database truncation if the environment is production
if Rails.env.production?
abort('The Rails environment is running in production mode!')
Expand Down