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
4 changes: 2 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def normalize_encoded_params
return unless request.get? || request.head?

ENCODED_PARAM_KEYS.each do |key|
params[key] = CGI.unescape(params[key]) if params[key]
params[key] = CGI.unescape(params[key]) if params[key].is_a?(String)
end
end

Expand Down Expand Up @@ -47,7 +47,7 @@ def render_not_found
end

def admin_for_all_hubs?
current_user.admin && current_user.hub == "All"
current_user.admin? && current_user.hub == "All"
end
helper_method :admin_for_all_hubs?

Expand Down
8 changes: 4 additions & 4 deletions app/lib/metadata_completeness.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ def end_date=(end_date)

def hub_csv
@hub_csv ||= Rails.cache.fetch("mc_csv:hub:#{@end_date}", expires_in: 24.hours) do
response = sThree_response("provider.csv")
response = s3_response("provider.csv")
response ? csv_data(response).to_a : []
end
end

def contributor_csv
@contributor_csv ||= Rails.cache.fetch("mc_csv:contributor:#{@end_date}", expires_in: 24.hours) do
response = sThree_response("contributor.csv")
response = s3_response("contributor.csv")
response ? csv_data(response).to_a : []
end
end
Expand All @@ -63,7 +63,7 @@ def file_date
#
# @return [Aws::S3::Types::GetObjectOutput, nil]
#
def sThree_response(file_name)
def s3_response(file_name)
date = @end_date
response = nil

Expand Down Expand Up @@ -113,7 +113,7 @@ def csv_data(response)
end

##
# Minimum data that data is expected to be available.
# Minimum date that data is expected to be available.
# @return Date
def min_date
Date.new(Settings.mc_min_date.year.to_i, Settings.mc_min_date.month.to_i)
Expand Down
2 changes: 1 addition & 1 deletion app/views/contributors/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
function toggle_column(element) {
var els = document.getElementsByClassName(element.value);

if (element.checked == true) {
if (element.checked) {
Array.prototype.forEach.call(els, function(el) {
el.style.display="table-cell";
});
Expand Down
20 changes: 1 addition & 19 deletions config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
# confirmation, reset password and unlock tokens in the database.
# Devise will use the `secret_key_base` as its `secret_key`
# by default. You can change it below and use your own secret key.
# config.secret_key = '64a8b3903da2d72835b4d4fe3b4b2081c9badfc50e67538ad8a967503e37ac18a589654877c1207e3018f09f44d84c6b1f51ab676174b04830da9ee0476ad26a'


# ==> Controller configuration
# Configure the parent class to the devise controllers.
# config.parent_controller = 'DeviseController'
Expand Down Expand Up @@ -114,7 +113,6 @@
config.stretches = Rails.env.test? ? 1 : 11

# Set up a pepper to generate the hashed password.
# config.pepper = 'd2d18e649f854a39e1d5b7eb986d668d19494684c0795102013c2eb8d741e02f4cce4b2b1f92a1a147502cae7e6125d42ffea00469e9299e2e1dc6e93e989abb'

# Send a notification to the original email when the user's email is changed.
# config.send_email_changed_notification = false
Expand Down Expand Up @@ -258,22 +256,6 @@
# up on your models and hooks.
# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'

# ==> Warden configuration
# Warden 1.2.9 raises "Invalid strategy <name>" for any Devise module included
# in the scope's strategy list that has no Warden::Strategies registration.
# :database_authenticatable and :rememberable are real Warden strategies;
# the others (:recoverable, :trackable, :validatable) are Devise-only modules
# that need no-op stubs so Warden can look them up without raising.
# Remove once Devise is upgraded to 5.x.
config.warden do |manager|
%i[recoverable trackable validatable].each do |strategy|
manager.strategies.add(strategy) do
def valid?; false; end
def authenticate!; pass; end
end unless Warden::Strategies[strategy]
end
end

# ==> Mountable engine configurations
# When using Devise inside an engine, let's call it `MyEngine`, and this engine
# is mountable, there are some extra configurations to be taken into account.
Expand Down
Loading