Skip to content

Commit e723f45

Browse files
committed
fixed rubocop & updated version
1 parent d51ad3e commit e723f45

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+94
-91
lines changed

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ AllCops:
1818
NewCops: enable
1919
TargetRubyVersion: 2.7
2020

21+
Gemspec/DevelopmentDependencies:
22+
Enabled: false
23+
2124
Layout/LineLength:
2225
Max: 120
2326

app/controllers/lcms/engine/admin/documents_controller.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ def reimport_lesson_materials
127127

128128
def set_query_params
129129
@query_params = params[:query]
130-
&.permit(
131-
:broken_materials, :course, :grade, :inactive, :locale, :module, :only_failed, :reimport_required,
132-
:search_term, :sort_by
133-
) || {}
130+
&.permit(
131+
:broken_materials, :course, :grade, :inactive, :locale, :module, :only_failed,
132+
:reimport_required, :search_term, :sort_by
133+
) || {}
134134
end
135135
end
136136
end

app/controllers/lcms/engine/admin/materials_controller.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ def gdoc_files_from(url)
103103

104104
def set_query_params
105105
@query_params = params[:query]
106-
&.permit(
107-
:course, :lesson, :name_date, :orientation, :search_term, :search_file_name, :sort_by, :title, :type,
108-
:unit
109-
) || {}
106+
&.permit(
107+
:course, :lesson, :name_date, :orientation, :search_term, :search_file_name, :sort_by,
108+
:title, :type, :unit
109+
) || {}
110110
end
111111
end
112112
end

app/entities/lcms/engine/external_page.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class ExternalPage
1111
attribute :description, String
1212
attribute :permalink, String
1313
attribute :slug, String
14-
attribute :keywords, Array[String], default: []
14+
attribute :keywords, [String], default: []
1515
attribute :teaser, String
1616
attribute :title, String
1717

app/forms/lcms/engine/curriculum_form.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ class CurriculumForm
77
include Virtus.model
88
include ActiveModel::Model
99

10-
attribute :change_log, Array[Hash]
10+
attribute :change_log, [Hash]
1111

1212
def initialize(params = {})
1313
parsed_change_log = parse_change_log params
14-
super params.merge(change_log: parsed_change_log)
14+
super(params.merge(change_log: parsed_change_log))
1515
end
1616

1717
def save

app/helpers/lcms/engine/resource_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def resource_breadcrumbs_with_links(resource)
4646

4747
[].tap do |result|
4848
pieces.each_with_index do |piece, idx|
49-
((result << piece) && next) if idx.zero?
49+
(result << piece) && next if idx.zero?
5050

5151
slug = Slug.build_from(pieces[0..idx])
5252

app/helpers/lcms/engine/view_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def color_code(model, base: false)
105105

106106
def selected_id?(id)
107107
selected_ids = params[:selected_ids]
108-
return unless selected_ids.present?
108+
return false unless selected_ids.present?
109109

110110
case selected_ids
111111
when Array

app/interactors/lcms/engine/explore_curriculum_interactor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def expanded_props
5757

5858
{
5959
active: active_branch,
60-
expanded: expanded? ? true : nil,
60+
expanded: expanded? || nil,
6161
results: grades.map do |curr|
6262
CurriculumResourceSerializer.new(
6363
curr,

app/middleware/remove_session.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ def call(env)
1616
# Don't delete the session cookie if:
1717
# - We're in the process of logging in (breaks CSRF for sign in form)
1818
# - We're logged in (needed for Devise)
19-
skip_delete = (
19+
skip_delete =
2020
path =~ %r{^/users} ||
2121
user_key.present? ||
2222
headers[SET_COOKIE].blank?
23-
)
2423

2524
signing_out = path == '/users/sign_out'
2625

app/models/lcms/engine/search/document.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ class Document < ElasticSearchDocument
2222
attribute :position, String
2323
attribute :slug, String
2424
attribute :subject, String
25-
attribute :tag_authors, Array[String]
26-
attribute :tag_keywords, Array[String]
27-
attribute :tag_standards, Array[String]
28-
attribute :tag_texts, Array[String]
25+
attribute :tag_authors, [String]
26+
attribute :tag_keywords, [String]
27+
attribute :tag_standards, [String]
28+
attribute :tag_texts, [String]
2929
attribute :teaser, String
3030
attribute :title, String
3131

0 commit comments

Comments
 (0)