Browse Source

Blank line cops

Layout/BlockendNewLine
Layout/EmptyLines
Layout/EmptyLineAfterGuardClause
Layout/EmptyLinesAroundAccessModifier
Layout/EmptyLinesAroundBlockBody
Layout/EmptyLinesAroundClassBody
Layout/EmptyLinesAroundMethodBody
Maarten van den Berg 6 years ago
parent
commit
5d4fea3138

+ 1 - 0
app/controllers/activities_controller.rb

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

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

58
   # @return [DateTime] the parsed input.
58
   # @return [DateTime] the parsed input.
59
   def try_parse_datetime(input = nil)
59
   def try_parse_datetime(input = nil)
60
     return unless input
60
     return unless input
61
+
61
     begin
62
     begin
62
       DateTime.parse input
63
       DateTime.parse input
63
     rescue ArgumentError
64
     rescue ArgumentError

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

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

+ 1 - 0
app/controllers/api_controller.rb

9
   end
9
   end
10
 
10
 
11
   protected
11
   protected
12
+
12
   def api_require_authentication!
13
   def api_require_authentication!
13
     return if is_logged_in?
14
     return if is_logged_in?
14
 
15
 

+ 1 - 0
app/controllers/application_controller.rb

6
   include ApplicationHelper
6
   include ApplicationHelper
7
 
7
 
8
   private
8
   private
9
+
9
   def invalid_auth_token
10
   def invalid_auth_token
10
     render text: I18n.t(:invalid_csrf), status: 400
11
     render text: I18n.t(:invalid_csrf), status: 400
11
   end
12
   end

+ 2 - 0
app/controllers/authentication_controller.rb

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

+ 1 - 0
app/controllers/groups_controller.rb

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

+ 1 - 0
app/controllers/members_controller.rb

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

+ 1 - 0
app/controllers/people_controller.rb

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

+ 1 - 0
app/helpers/groups_helper.rb

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

+ 2 - 2
app/models/activity.rb

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

+ 1 - 1
app/models/participant.rb

80
     self.save
80
     self.save
81
 
81
 
82
     return unless self.person.send_attendance_reminder
82
     return unless self.person.send_attendance_reminder
83
+
83
     ParticipantMailer.attendance_reminder(self.person, self.activity).deliver_later
84
     ParticipantMailer.attendance_reminder(self.person, self.activity).deliver_later
84
   end
85
   end
85
 
86
 
94
   def clear_subgroup
95
   def clear_subgroup
95
     self.subgroup = nil
96
     self.subgroup = nil
96
   end
97
   end
97
-
98
 end
98
 end

+ 1 - 0
app/models/person.rb

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

+ 1 - 0
app/models/token.rb

41
   before_validation :generate_expiry, on: :create
41
   before_validation :generate_expiry, on: :create
42
 
42
 
43
   private
43
   private
44
+
44
   def generate_token
45
   def generate_token
45
     candidate = nil
46
     candidate = nil
46
     loop do
47
     loop do

+ 1 - 0
app/models/user.rb

26
   end
26
   end
27
 
27
 
28
   private
28
   private
29
+
29
   # Assert that the user's email address is the same as the email address of
30
   # Assert that the user's email address is the same as the email address of
30
   # the associated Person.
31
   # the associated Person.
31
   def email_same_as_person
32
   def email_same_as_person

+ 0 - 1
config/puma.rb

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

+ 0 - 1
db/seeds.rb

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

+ 0 - 1
test/controllers/authentication_controller_test.rb

15
     get authentication_forgotten_password_url
15
     get authentication_forgotten_password_url
16
     assert_response :success
16
     assert_response :success
17
   end
17
   end
18
-
19
 end
18
 end

+ 0 - 1
test/controllers/dashboard_controller_test.rb

5
     get dashboard_home_url
5
     get dashboard_home_url
6
     assert_response :success
6
     assert_response :success
7
   end
7
   end
8
-
9
 end
8
 end

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

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