Browse Source

Keep code style in Lectures controller consistent with other files

Frans Bergman 7 years ago
parent
commit
16753630f5
1 changed files with 6 additions and 5 deletions
  1. 6 5
      app/controllers/lectures_controller.rb

+ 6 - 5
app/controllers/lectures_controller.rb

@@ -1,9 +1,10 @@
 class LecturesController < ApplicationController
-  before_action :set_lecture, only: %i[show edit update destroy]
-  before_action :check_can_edit, only: %i[edit update]
-  before_action :check_can_create, only: %i[create]
+  before_action :set_lecture, only: [:show, :edit, :update, :destroy]
+  before_action :check_can_edit, only: [:edit, :update]
+  before_action :check_can_create, only: [:create]
 
-  def show; end
+  def show
+  end
 
   def new
     @lecture = Lecture.new
@@ -48,7 +49,7 @@ class LecturesController < ApplicationController
   def lecture_params
     allowed = [:description]
 
-    allowed += %i[course_id starts_at ends_at location] if current_user.is_course_administrator?(current_course)
+    allowed += [:course_id, :starts_at, :ends_at, :location] if current_user.is_course_administrator?(current_course)
 
     params.require(:lecture).permit(*allowed)
   end