From 79634f8faff920ca74701b953725430168b9a5de Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Fri, 25 Nov 2016 11:57:20 -0500 Subject: [PATCH] code climate fixes --- .codeclimate.yml | 2 ++ app/controllers/notifications_controller.rb | 2 +- app/models/user.rb | 2 +- config/initializers/mailboxer.rb | 18 +++++++------- config/routes.rb | 26 ++++++++++++++++----- 5 files changed, 33 insertions(+), 17 deletions(-) diff --git a/.codeclimate.yml b/.codeclimate.yml index 719b2807..a187069d 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -20,6 +20,8 @@ engines: enabled: true rubocop: enabled: true + exclude_fingerprints: + - 74f18007b920e8d81148d2f6a2756534 ratings: paths: - 'Gemfile.lock' diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index f4fd1e8f..9d8c8eb2 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class NotificationsController < ApplicationController before_action :set_receipts, only: [:index, :show, :mark_read, :mark_unread] before_action :set_notification, only: [:show, :mark_read, :mark_unread] @@ -66,5 +67,4 @@ class NotificationsController < ApplicationController def set_receipt @receipt = @receipts.find_by(notification_id: params[:id]) end - end diff --git a/app/models/user.rb b/app/models/user.rb index f3169d1d..dab54974 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -111,7 +111,7 @@ class User < ApplicationRecord self[:settings] = val end - def mailboxer_email(object) + def mailboxer_email(_object) nil # email end diff --git a/config/initializers/mailboxer.rb b/config/initializers/mailboxer.rb index a9b4a612..9e1efe66 100644 --- a/config/initializers/mailboxer.rb +++ b/config/initializers/mailboxer.rb @@ -1,21 +1,21 @@ +# frozen_string_literal: true Mailboxer.setup do |config| - - #Configures if your application uses or not email sending for Notifications and Messages + # Configures if your application uses or not email sending for Notifications and Messages config.uses_emails = true - #Configures the default from for emails sent for Messages and Notifications - config.default_from = "no-reply@metamaps.cc" + # Configures the default from for emails sent for Messages and Notifications + config.default_from = 'no-reply@metamaps.cc' - #Configures the methods needed by mailboxer + # Configures the methods needed by mailboxer config.email_method = :mailboxer_email config.name_method = :name - #Configures if you use or not a search engine and which one you are using - #Supported engines: [:solr,:sphinx] + # Configures if you use or not a search engine and which one you are using + # Supported engines: [:solr,:sphinx] config.search_enabled = false config.search_engine = :solr - #Configures maximum length of the message subject and body + # Configures maximum length of the message subject and body config.subject_max_length = 255 - config.body_max_length = 32000 + config.body_max_length = 32_000 end diff --git a/config/routes.rb b/config/routes.rb index b34908fd..dc7e3e8a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -20,12 +20,25 @@ Metamaps::Application.routes.draw do post 'events/:event', action: :events get :contains - get :request_access, to: 'access#request_access' - get 'approve_access/:request_id', to: 'access#approve_access', as: :approve_access - get 'deny_access/:request_id', to: 'access#deny_access', as: :deny_access - post :access_request, to: 'access#access_request', default: { format: :json } - post 'approve_access/:request_id', to: 'access#approve_access_post', default: { format: :json } - post 'deny_access/:request_id', to: 'access#deny_access_post', default: { format: :json } + get :request_access, + to: 'access#request_access' + get 'approve_access/:request_id', + to: 'access#approve_access', + as: :approve_access + get 'deny_access/:request_id', + to: 'access#deny_access', + as: :deny_access + + post :access_request, + to: 'access#access_request', + default: { format: :json } + post 'approve_access/:request_id', + to: 'access#approve_access_post', + default: { format: :json } + post 'deny_access/:request_id', + to: 'access#deny_access_post', + default: { format: :json } + post :access, to: 'access#access', default: { format: :json } post :star, to: 'stars#create', default: { format: :json } @@ -115,3 +128,4 @@ Metamaps::Application.routes.draw do get 'load_url_title' end end +# rubocop:enable Rubocop/Metrics/BlockLength