Skip to content

Commit b5d5de9

Browse files
committed
Additional rubocop formatting
1 parent 5cc6511 commit b5d5de9

19 files changed

+52
-20
lines changed

app/controllers/watched_area_controller.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def climbing_area
3434
.first
3535

3636
respond_to do |format|
37-
format.json {
37+
format.json do
3838
render :json => @rainy_day_area,
3939
:include => {
4040
:climbing_area => {
@@ -47,7 +47,7 @@ def climbing_area
4747
}
4848
},
4949
:except => %i[created_at updated_at id]
50-
}
50+
end
5151
end
5252
end
5353

app/helpers/material_forms_helper.rb

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# frozen_string_literal: true
22

3+
# rubocop:disable Rails/HelperInstanceVariable
34
module MaterialFormsHelper
45
class MaterialFormBuilder < ActionView::Helpers::FormBuilder
56
def validation_message(attribute)
@@ -11,17 +12,17 @@ def validation_message(attribute)
1112
)
1213
end
1314

14-
def text_field(attribute, options={})
15+
def text_field(attribute, options = {})
1516
options = append_material_class(options)
1617
super
1718
end
1819

19-
def email_field(attribute, options={})
20+
def email_field(attribute, options = {})
2021
options = append_material_class(options)
2122
super
2223
end
2324

24-
def telephone_field(attribute, options={})
25+
def telephone_field(attribute, options = {})
2526
options = append_material_class(options)
2627
super
2728
end
@@ -37,7 +38,7 @@ def select(attribute, choices = nil, options = {},
3738
super
3839
end
3940

40-
def submit(value=nil, options={})
41+
def submit(value = nil, options = {})
4142
options = append_material_class(options, 'btn btn-primary')
4243
super
4344
end
@@ -53,3 +54,5 @@ def append_material_class(options = {}, html_class = 'form-control')
5354
end
5455
end
5556
end
57+
58+
# rubocop:enable Rails/HelperInstanceVariable

app/mailers/admin_mailer.rb

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
# frozen_string_literal: true
22

33
class AdminMailer < Devise::Mailer
4-
default from: '[email protected]'
5-
layout 'mailer'
4+
default from: '[email protected]'
5+
layout 'mailer'
66

7-
def new_user_waiting_for_approval(email)
8-
@email = email
9-
mail(to: '[email protected]', subject: 'New User Awaiting Admin Approval')
10-
end
7+
def new_user_waiting_for_approval(email)
8+
@email = email
9+
10+
mail(
11+
12+
subject: 'New User Awaiting Admin Approval'
13+
)
14+
end
1115
end

app/models/climbing_area.rb

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# frozen_string_literal: true
22

33
class ClimbingArea < ApplicationRecord
4-
has_many :rainy_day_areas
4+
has_many :rainy_day_areas, dependent: :destroy
55
has_many :watched_areas, through: :rainy_day_areas
6-
has_one :location, :inverse_of => :climbing_area, required: true
6+
has_one :location,
7+
inverse_of: :climbing_area,
8+
dependent: :destroy,
9+
required: true
710

811
accepts_nested_attributes_for :location
912

app/models/local_climbing_org.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
class LocalClimbingOrg < ApplicationRecord
4-
has_many :watched_areas
4+
has_many :watched_areas, dependent: :nullify
55
end

app/models/watched_area.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
class WatchedArea < ApplicationRecord
4-
has_many :rainy_day_areas
4+
has_many :rainy_day_areas, dependent: :destroy
55
has_many :climbing_areas, through: :rainy_day_areas
66

77
belongs_to :local_climbing_org

rails.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# The following comments fill some of the gaps in Solargraph's understanding of
24
# Rails apps. Since they're all in YARD, they get mapped in Solargraph but
35
# ignored at runtime.

test/controllers/castlerock_controller_test.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'test_helper'
24

35
class CastlerockControllerTest < ActionDispatch::IntegrationTest

test/controllers/redrock_controller_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'test_helper'
44

55
class RedrockControllerTest < ActionDispatch::IntegrationTest
6-
test "should get index" do
6+
test 'should get index' do
77
get redrock_index_url
88
assert_response :success
99
end

test/mailers/admin_mailer_test.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'test_helper'
24

35
class AdminMailerTest < ActionMailer::TestCase

test/mailers/membership_mailer_test.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'test_helper'
24

35
class MembershipMailerTest < ActionMailer::TestCase
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Preview all emails at http://localhost:3000/rails/mailers/admin_mailer
24
class AdminMailerPreview < ActionMailer::Preview
3-
45
end

test/mailers/previews/membership_mailer_preview.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
# Preview all emails at http://localhost:3000/rails/mailers/membership_mailer
44
class MembershipMailerPreview < ActionMailer::Preview
55
def new_membership_email
6-
MembershipMailer.with(application: JointMembershipApplication.where(paid_cash: false).first)
7-
.signup_confirmation
6+
MembershipMailer.with(
7+
application: JointMembershipApplication.where(paid_cash: false).first
8+
).signup_confirmation
89
end
910
end

test/models/climbing_area_test.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'test_helper'
24

35
class ClimbingAreaTest < ActiveSupport::TestCase

test/models/local_climbing_org_test.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'test_helper'
24

35
class LocalClimbingOrgTest < ActiveSupport::TestCase

test/models/location_test.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'test_helper'
24

35
class LocationTest < ActiveSupport::TestCase

test/models/rainy_day_area_test.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'test_helper'
24

35
class RainyDayAreaTest < ActiveSupport::TestCase

test/models/user_test.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'test_helper'
24

35
class UserTest < ActiveSupport::TestCase

test/models/watched_area_test.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'test_helper'
24

35
class WatchedAreaTest < ActiveSupport::TestCase

0 commit comments

Comments
 (0)