Skip to content

Commit 6607825

Browse files
authored
Merge pull request #951 from amatsuda/trivial_changes
Code cleanups
2 parents c475a67 + 6c29dca commit 6607825

Some content is hidden

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

49 files changed

+65
-226
lines changed

Guardfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ guard :rspec, cmd: 'bin/rspec' do
2222
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
2323
end
2424

25-
2625
guard 'livereload' do
2726
watch(%r{app/views/.+\.(erb|haml|slim)$})
2827
watch(%r{app/helpers/.+\.rb})

app/assets/stylesheets/modules/data_tables.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* Consider breaking the following into modules */
21
/* datatables */
32
table.datatable {
43
thead {

app/controllers/admin/application_controller.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ class Admin::ApplicationController < ApplicationController
66

77
def require_admin
88
unless current_user.admin?
9-
flash[:danger] = "You must be signed in as an administrator to access this page."
10-
redirect_to events_path
9+
redirect_to events_path, flash: {danger: 'You must be signed in as an administrator to access this page.'}
1110
end
1211
end
13-
1412
end

app/controllers/admin/events_controller.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@ def create
1515
@event.teammates.build(email: current_user.email, role: "organizer").accept(current_user)
1616
redirect_to event_staff_path(@event)
1717
else
18-
flash[:danger] = "There was a problem saving your event; please review the form for issues and try again."
18+
flash.now[:danger] = 'There was a problem saving your event; please review the form for issues and try again.'
1919
render :new
2020
end
2121
end
2222

2323
def destroy
2424
@event.destroy
25-
flash[:info] = "Your event has been deleted."
26-
redirect_to events_path, status: :see_other
25+
redirect_to events_path, status: :see_other, flash: {info: 'Your event has been deleted.'}
2726
end
2827

2928
def archive

app/controllers/application_controller.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ def event_staff?(event)
101101
def require_user
102102
unless user_signed_in?
103103
session[:target] = request.path
104-
flash[:danger] = "You must be signed in to access this page. If you haven't created an account, please create one."
105-
redirect_to new_user_session_url
104+
redirect_to new_user_session_url, flash: {danger: "You must be signed in to access this page. If you haven't created an account, please create one."}
106105
end
107106
end
108107

@@ -116,8 +115,7 @@ def require_event
116115
if @event
117116
set_current_event(@event)
118117
else
119-
flash[:danger] = "Your event could not be found, please check the url."
120-
redirect_to events_path
118+
redirect_to events_path, flash: {danger: 'Your event could not be found, please check the url.'}
121119
end
122120
end
123121

@@ -130,8 +128,7 @@ def require_proposal
130128
end
131129

132130
def user_not_authorized
133-
flash[:alert] = "You are not authorized to perform this action."
134-
redirect_to(request.referrer || root_path)
131+
redirect_to (request.referrer || root_path), flash: {alert: 'You are not authorized to perform this action.'}
135132
end
136133

137134
def event_params

app/controllers/concerns/program_support.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,4 @@ def set_proposal_counts
2828
@all_waitlisted_track_count ||= current_event.stats.all_waitlisted_proposals(sticky_selected_track)
2929
end
3030
end
31-
3231
end

app/controllers/concerns/schedule_support.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ module ScheduleSupport
77
before_action :require_organizer
88
before_action :enable_staff_schedule_subnav
99
end
10-
1110
end

app/controllers/errors_controller.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
class ErrorsController < ApplicationController
2-
32
def not_found
43
render :status => 404
54
end
@@ -11,5 +10,4 @@ def unacceptable
1110
def internal_error
1211
render :status => 500
1312
end
14-
1513
end

app/controllers/home_controller.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
class HomeController < ApplicationController
2-
32
# Go to:
43
# - the currently live event guidelines page, or
54
# - /events if no current event
@@ -11,5 +10,4 @@ def show
1110
redirect_to events_url
1211
end
1312
end
14-
1513
end

app/controllers/notifications_controller.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ def show
1515

1616
def mark_all_as_read
1717
current_user.notifications.where(read_at: nil).update_all(read_at: Time.current)
18-
flash[:notice] = "All notifications marked as read"
19-
redirect_to notifications_path, status: :see_other
18+
redirect_to notifications_path, status: :see_other, flash: {notice: "All notifications marked as read"}
2019
end
2120
end

0 commit comments

Comments
 (0)