Skip to content

Commit

Permalink
RuboCop cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffyjefflabs committed Jul 24, 2018
1 parent b0a1df7 commit bdec1ad
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 16 deletions.
5 changes: 3 additions & 2 deletions .rubocop.yml
Expand Up @@ -4,11 +4,12 @@ AllCops:
DisplayCopNames: true
TargetRubyVersion: 2.3
Exclude:
- 'docker/**/*'
- 'docker/**/*' # local docker storage
- 'lib/magic_cloud/*.rb'
- 'lib/magic_cloud/*/*.rb'
- 'app/models/commontator/*.rb'
- 'db/schema.rb' #generated file
- 'db/schema.rb' # generated file
- 'bin/*' # rails framework

Metrics/AbcSize:
Max: 50
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
@@ -1,6 +1,6 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require File.expand_path('../config/application', __FILE__)
require File.expand_path('config/application', __dir__)

Rails.application.load_tasks
2 changes: 1 addition & 1 deletion app/controllers/passwords_controller.rb
Expand Up @@ -8,7 +8,7 @@ def create
if successfully_sent?(resource)
render json: { success: true }
else
render json: { success: false, errors: resource.errors }, status: 500
render json: { success: false, errors: resource.errors }, status: :internal_server_error
end
end
end
2 changes: 1 addition & 1 deletion app/models/code_cell.rb
Expand Up @@ -125,7 +125,7 @@ def self.cumulative_fail_rates
end
cumulative = {}
total = 0
fail_rates.to_a.reverse.each do |rate, count|
fail_rates.to_a.reverse_each do |rate, count|
total += count
cumulative[rate.to_f / 100.0] = total / cell_metrics.count.to_f
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/group.rb
@@ -1,7 +1,7 @@
# Group model
class Group < ActiveRecord::Base
# Landing page notebook for group view
belongs_to :landing, class_name: 'Notebook' # rubocop: disable Rails/InverseOf (not used)
belongs_to :landing, class_name: 'Notebook'

# Notebooks owned by this group
has_many :notebooks, as: :owner, dependent: :destroy, inverse_of: 'owner'
Expand Down
2 changes: 1 addition & 1 deletion app/models/notebook_similarity.rb
@@ -1,7 +1,7 @@
# Model for notebook similarity scores
class NotebookSimilarity < ActiveRecord::Base
belongs_to :notebook
belongs_to :other_notebook, class_name: 'Notebook' # rubocop: disable Rails/InverseOf
belongs_to :other_notebook, class_name: 'Notebook'

validates :notebook, :other_notebook, :score, presence: true

Expand Down
2 changes: 1 addition & 1 deletion app/models/user_similarity.rb
@@ -1,7 +1,7 @@
# Model for user similarity scores
class UserSimilarity < ActiveRecord::Base
belongs_to :user
belongs_to :other_user, class_name: 'User' # rubocop: disable Rails/InverseOf
belongs_to :other_user, class_name: 'User'

validates :user, :other_user, :score, presence: true

Expand Down
2 changes: 1 addition & 1 deletion app/models/users_also_view.rb
@@ -1,7 +1,7 @@
# Model for users-also-viewed relationship
class UsersAlsoView < ActiveRecord::Base
belongs_to :notebook
belongs_to :other_notebook, class_name: 'Notebook' # rubocop: disable Rails/InverseOf
belongs_to :other_notebook, class_name: 'Notebook'

validates :notebook, :other_notebook, :score, presence: true

Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
@@ -1,4 +1,4 @@
require File.expand_path('../boot', __FILE__)
require File.expand_path('boot', __dir__)

require 'rails/all'
require 'active_record/connection_adapters/mysql2_adapter'
Expand Down
2 changes: 1 addition & 1 deletion config/boot.rb
@@ -1,3 +1,3 @@
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)

require 'bundler/setup' # Set up gems listed in the Gemfile.
4 changes: 2 additions & 2 deletions config/environment.rb
@@ -1,12 +1,12 @@
# Load the Rails application.

libs = File.expand_path('../../lib', __FILE__)
libs = File.expand_path('../lib', __dir__)

Dir["#{libs}/*.rb"].each do |lib|
require lib
end

require File.expand_path('../application', __FILE__)
require File.expand_path('application', __dir__)

Encoding.default_internal = Encoding::UTF_8
Encoding.default_external = Encoding::UTF_8
Expand Down
4 changes: 2 additions & 2 deletions script/cronic
Expand Up @@ -9,8 +9,8 @@
# script/cronic -k -P tmp/pids/cronic.pid


APP_PATH = File.expand_path('../../config/application', __FILE__)
require File.expand_path('../../config/boot', __FILE__)
APP_PATH = File.expand_path('../config/application', __dir__)
require File.expand_path('../config/boot', __dir__)

require APP_PATH
Rails.application.require_environment!
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
@@ -1,5 +1,5 @@
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require File.expand_path('../config/environment', __dir__)
require 'rails/test_help'

# :nodoc:
Expand Down

0 comments on commit bdec1ad

Please sign in to comment.