Skip to content

Commit

Permalink
Rubocop fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanmsmith committed Jan 25, 2024
1 parent 8015971 commit 57a5b15
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,6 @@ Minitest/EmptyLineBeforeAssertionMethods:
Enabled: false
Minitest/MultipleAssertions:
Enabled: false

FactoryBot/ExcessiveCreateList:
Enabled: false
2 changes: 1 addition & 1 deletion app/controllers/admin/reviews_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def index
typed_params = TypedParams.extract!(IndexParams, params)
page = typed_params.page

@reviews = Review.all.where(status: :pending).order(updated_at: :desc).page(page)
@reviews = Review.where(status: :pending).order(updated_at: :desc).page(page)
end

class ShowParams < T::Struct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace :data_migration do

Searchkick.disable_callbacks

Section.all.find_each do |section|
Section.find_each do |section|
Rails.logger.info("Section: #{section.id}, Section instructors: #{section.registrar_instructors}, Section instructor id: #{section.instructor_id}")
if (section.registrar_instructors == ["No instructor"]) || (section.registrar_instructors == ["No instructors"]) || (section.registrar_instructors == ["The Staff"])
Rails.logger.info("Section has no instructor")
Expand Down Expand Up @@ -45,7 +45,7 @@ namespace :data_migration do
end
end

orphaned_instructors = Instructor.all.where(registrar_listing: nil)
orphaned_instructors = Instructor.where(registrar_listing: nil)
Rails.logger.info("Orphaned instructors: #{orphaned_instructors.size}, deleting")
orphaned_instructors.destroy_all

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace :data_migration do
Rails.logger.level = :info

ActiveRecord::Base.transaction do
User.all.find_each do |user|
User.find_each do |user|
user.subscribe("announcements") unless user.subscribed?("announcements")
user.save
end
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/populate_instructors.rake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace :populate do
end
Rails.logger.info("Using term #{term.readable}")

SubjectArea.all.find_each do |subject_area|
SubjectArea.find_each do |subject_area|
Rails.logger.info("Subject Area: #{subject_area.name}")
sections = Section.joins(:instructor, :course).where("courses.subject_area_id": subject_area)
Section.joins(:course).where(term:, "courses.subject_area_id": subject_area).find_each do |section|
Expand Down
2 changes: 1 addition & 1 deletion test/controllers/checkouts_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CheckoutsControllerTest < ActionDispatch::IntegrationTest
"cancel_url" => "http://www.example.com/my-courses?session_id={CHECKOUT_SESSION_ID}",
"customer" => "cus_9s6XBnVi5gbXub",
"line_items" => [
{ "price" => ENV.fetch("NOTIFICATION_TOKENS_PRICE"), "quantity" => "1" },
{ "price" => ENV.fetch("NOTIFICATION_TOKENS_PRICE"), "quantity" => "1" },
],
"mode" => "payment",
"payment_method_types" => ["card"],
Expand Down
6 changes: 3 additions & 3 deletions test/test_helpers/notification_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ module NotificationHelper
extend T::Sig

sig { params(notification_class: T.class_of(Noticed::Base), user: User, kwargs: T.anything).void }
def expect_notification_to_be_sent(notification_class, user, **kwargs)
notification = notification_class.with(**kwargs)
Mock.expects(notification_class, :with).with(**kwargs).returns(notification)
def expect_notification_to_be_sent(notification_class, user, **)
notification = notification_class.with(**)
Mock.expects(notification_class, :with).with(**).returns(notification)
Mock.expects(notification, :deliver_later).with(user)
end

Expand Down

0 comments on commit 57a5b15

Please sign in to comment.