Ver Código Fonte

Blank line cops

Layout/BlockendNewLine
Layout/EmptyLines
Layout/EmptyLineAfterGuardClause
Layout/EmptyLinesAroundAccessModifier
Layout/EmptyLinesAroundBlockBody
Layout/EmptyLinesAroundClassBody
Layout/EmptyLinesAroundMethodBody
Maarten van den Berg 6 anos atrás
pai
commit
5d4fea3138

+ 1 - 0
app/controllers/activities_controller.rb

@@ -308,6 +308,7 @@ class ActivitiesController < ApplicationController
308 308
   end
309 309
 
310 310
   private
311
+
311 312
     # The Activity's group takes precedence over whatever's in the URL, set_group not required (and can be mislead)
312 313
     def set_activity_and_group
313 314
       @activity = Activity.find(params[:id] || params[:activity_id])

+ 1 - 0
app/controllers/api/groups_controller.rb

@@ -58,6 +58,7 @@ class Api::GroupsController < ApiController
58 58
   # @return [DateTime] the parsed input.
59 59
   def try_parse_datetime(input = nil)
60 60
     return unless input
61
+
61 62
     begin
62 63
       DateTime.parse input
63 64
     rescue ArgumentError

+ 1 - 0
app/controllers/api/people_controller.rb

@@ -14,6 +14,7 @@ class Api::PeopleController < ApiController
14 14
   end
15 15
 
16 16
   private
17
+
17 18
     # Use callbacks to share common setup or constraints between actions.
18 19
     def set_person
19 20
       @person = Person.find(params[:id])

+ 1 - 0
app/controllers/api_controller.rb

@@ -9,6 +9,7 @@ class ApiController < ActionController::Base
9 9
   end
10 10
 
11 11
   protected
12
+
12 13
   def api_require_authentication!
13 14
     return if is_logged_in?
14 15
 

+ 1 - 0
app/controllers/application_controller.rb

@@ -6,6 +6,7 @@ class ApplicationController < ActionController::Base
6 6
   include ApplicationHelper
7 7
 
8 8
   private
9
+
9 10
   def invalid_auth_token
10 11
     render text: I18n.t(:invalid_csrf), status: 400
11 12
   end

+ 2 - 0
app/controllers/authentication_controller.rb

@@ -94,6 +94,7 @@ class AuthenticationController < ApplicationController
94 94
     if not token_valid? token
95 95
       return
96 96
     end
97
+
97 98
     render layout: 'void'
98 99
   end
99 100
 
@@ -149,6 +150,7 @@ class AuthenticationController < ApplicationController
149 150
   end
150 151
 
151 152
   private
153
+
152 154
   def session_params
153 155
     params.require(:session).permit(:email, :password, :remember_me)
154 156
   end

+ 1 - 0
app/controllers/groups_controller.rb

@@ -155,6 +155,7 @@ class GroupsController < ApplicationController
155 155
   end
156 156
 
157 157
   private
158
+
158 159
     # Use callbacks to share common setup or constraints between actions.
159 160
     def set_group
160 161
       @group = Group.find(params[:group_id] || params[:id])

+ 1 - 0
app/controllers/members_controller.rb

@@ -133,6 +133,7 @@ class MembersController < ApplicationController
133 133
   end
134 134
 
135 135
   private
136
+
136 137
     # Use callbacks to share common setup or constraints between actions.
137 138
     def set_member
138 139
       @member = Member.find(params[:id])

+ 1 - 0
app/controllers/people_controller.rb

@@ -99,6 +99,7 @@ class PeopleController < ApplicationController
99 99
   end
100 100
 
101 101
   private
102
+
102 103
     # Use callbacks to share common setup or constraints between actions.
103 104
     def set_person
104 105
       @person = Person.find(params[:id])

+ 1 - 0
app/helpers/groups_helper.rb

@@ -1,6 +1,7 @@
1 1
 module GroupsHelper
2 2
   def require_membership!
3 3
     return unless require_login!
4
+
4 5
     if !(@group.is_member?(current_person) || current_person.is_admin?)
5 6
       flash_message(:danger, I18n.t('groups.membership_required'))
6 7
       redirect_to dashboard_home_path

+ 2 - 2
app/models/activity.rb

@@ -80,7 +80,8 @@ class Activity < ApplicationRecord
80 80
                if: Proc.new { |a| (a.previous_changes['deadline'] ||
81 81
                                    a.previous_changes['subgroup_division_enabled']) &&
82 82
                                   !a.subgroup_division_done &&
83
-                                  a.subgroup_division_enabled }
83
+                                  a.subgroup_division_enabled
84
+                   }
84 85
 
85 86
   # Get all people (not participants) that are organizers. Does not include
86 87
   # group leaders, although they may modify the activity as well.
@@ -160,7 +161,6 @@ class Activity < ApplicationRecord
160 161
       sg.is_assignable = dsg.is_assignable
161 162
       sg.save! # Should never fail, as DSG and SG have identical validation, and names cannot clash.
162 163
     end
163
-
164 164
   end
165 165
 
166 166
   # Create multiple Activities from data in a CSV file, assign to a group, return.

+ 1 - 1
app/models/participant.rb

@@ -80,6 +80,7 @@ class Participant < ApplicationRecord
80 80
     self.save
81 81
 
82 82
     return unless self.person.send_attendance_reminder
83
+
83 84
     ParticipantMailer.attendance_reminder(self.person, self.activity).deliver_later
84 85
   end
85 86
 
@@ -94,5 +95,4 @@ class Participant < ApplicationRecord
94 95
   def clear_subgroup
95 96
     self.subgroup = nil
96 97
   end
97
-
98 98
 end

+ 1 - 0
app/models/person.rb

@@ -191,6 +191,7 @@ class Person < ApplicationRecord
191 191
   end
192 192
 
193 193
   private
194
+
194 195
   # Assert that the person's birth date, if any, lies in the past.
195 196
   def birth_date_cannot_be_in_future
196 197
     if self.birth_date && self.birth_date > Date.today

+ 1 - 0
app/models/token.rb

@@ -41,6 +41,7 @@ class Token < ApplicationRecord
41 41
   before_validation :generate_expiry, on: :create
42 42
 
43 43
   private
44
+
44 45
   def generate_token
45 46
     candidate = nil
46 47
     loop do

+ 1 - 0
app/models/user.rb

@@ -26,6 +26,7 @@ class User < ApplicationRecord
26 26
   end
27 27
 
28 28
   private
29
+
29 30
   # Assert that the user's email address is the same as the email address of
30 31
   # the associated Person.
31 32
   def email_same_as_person

+ 0 - 1
config/puma.rb

@@ -21,7 +21,6 @@ if env == "production"
21 21
   stdout_redirect "#{ENV['AARDBEI_PATH']}/log/stdout", "#{ENV['AARDBEI_PATH']}/log/stderr", true
22 22
 end
23 23
 
24
-
25 24
 # Specifies the number of `workers` to boot in clustered mode.
26 25
 # Workers are forked webserver processes. If using threads and workers together
27 26
 # the concurrency of the application would be max `threads` * `workers`.

+ 0 - 1
db/seeds.rb

@@ -37,7 +37,6 @@ g = Group.create!(
37 37
   name: 'Teststam'
38 38
 )
39 39
 
40
-
41 40
 2.times do |i|
42 41
   gr = Group.create!(
43 42
     name: Faker::Team.name

+ 0 - 1
test/controllers/authentication_controller_test.rb

@@ -15,5 +15,4 @@ class AuthenticationControllerTest < ActionDispatch::IntegrationTest
15 15
     get authentication_forgotten_password_url
16 16
     assert_response :success
17 17
   end
18
-
19 18
 end

+ 0 - 1
test/controllers/dashboard_controller_test.rb

@@ -5,5 +5,4 @@ class DashboardControllerTest < ActionDispatch::IntegrationTest
5 5
     get dashboard_home_url
6 6
     assert_response :success
7 7
   end
8
-
9 8
 end

+ 0 - 1
test/mailers/previews/authentication_mailer_preview.rb

@@ -1,4 +1,3 @@
1 1
 # Preview all emails at http://localhost:3000/rails/mailers/authentication_mailer
2 2
 class AuthenticationMailerPreview < ActionMailer::Preview
3
-
4 3
 end