Fix new rubocop warnings

This commit is contained in:
Tom Hughes 2018-01-22 14:36:16 +00:00
parent 3988940e3c
commit a83030dab7
37 changed files with 94 additions and 213 deletions

View file

@ -34,9 +34,7 @@ module OpenStreetMap
config.paths["app/models"].skip_eager_load! if STATUS == :database_offline
# Use memcached for caching if required
if defined?(MEMCACHE_SERVERS)
config.cache_store = :mem_cache_store, MEMCACHE_SERVERS, { :namespace => "rails:cache" }
end
config.cache_store = :mem_cache_store, MEMCACHE_SERVERS, { :namespace => "rails:cache" } if defined?(MEMCACHE_SERVERS)
# Use logstash for logging if required
if defined?(LOGSTASH_PATH)

View file

@ -35,9 +35,7 @@ Rails.application.configure do
config.active_support.deprecation = :log
# Raise an error on page load if there are pending migrations.
unless STATUS == :database_offline
config.active_record.migration_error = :page_load
end
config.active_record.migration_error = :page_load unless STATUS == :database_offline
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large

View file

@ -93,9 +93,7 @@ Rails.application.configure do
end
# Do not dump schema after migrations.
unless STATUS == :database_offline
config.active_record.dump_schema_after_migration = false
end
config.active_record.dump_schema_after_migration = false unless STATUS == :database_offline
# Enable autoloading of dependencies.
config.enable_dependency_loading = true

View file

@ -7,9 +7,7 @@ module OpenStreetMap
class Cors < Rack::Cors
def call(env)
status, headers, body = super env
if headers["Access-Control-Allow-Origin"]
headers["Cache-Control"] = "no-cache"
end
headers["Cache-Control"] = "no-cache" if headers["Access-Control-Allow-Origin"]
[status, headers, body]
end
end

View file

@ -26,9 +26,7 @@ windowslive_options = { :name => "windowslive", :scope => "wl.signin,wl.emails"
github_options = { :name => "github", :scope => "user:email" }
wikipedia_options = { :name => "wikipedia", :client_options => { :site => "https://meta.wikimedia.org" } }
if defined?(GOOGLE_OPENID_REALM)
google_options[:openid_realm] = GOOGLE_OPENID_REALM
end
google_options[:openid_realm] = GOOGLE_OPENID_REALM if defined?(GOOGLE_OPENID_REALM)
Rails.application.config.middleware.use OmniAuth::Builder do
provider :openid, openid_options