Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Avoid looking up parameters already cached in instance variables #1608

Merged
merged 1 commit into from

2 participants

@ferrous26
Collaborator

Minor refactor/optimization that I noticed while updating the strong parameters.

@david-yz-liu david-yz-liu merged commit 0ba6f01 into MarkUsProject:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 4 deletions.
  1. +4 −4 app/controllers/annotations_controller.rb
View
8 app/controllers/annotations_controller.rb
@@ -14,7 +14,7 @@ def add_existing_annotation
@annotation.update_attributes({
x1: Integer(params[:x1]), x2: Integer(params[:x2]),
y1: Integer(params[:y1]), y2: Integer(params[:y2]),
- submission_file_id: params[:submission_file_id],
+ submission_file_id: @submission_file_id,
is_remark: is_remark,
annotation_number: submission.annotations.count + 1
})
@@ -23,7 +23,7 @@ def add_existing_annotation
@annotation.update_attributes({
line_start: params[:line_start],
line_end: params[:line_end],
- submission_file_id: params[:submission_file_id],
+ submission_file_id: @submission_file_id,
is_remark: is_remark,
annotation_number: submission.annotations.count + 1
})
@@ -51,14 +51,14 @@ def create
line_start: params[:line_start],
line_end: params[:line_end],
annotation_text_id: @text.id,
- submission_file_id: params[:submission_file_id],
+ submission_file_id: @submission_file_id,
is_remark: is_remark,
annotation_number: submission.annotations.count + 1
})
when 'image'
@annotation = ImageAnnotation.create({
annotation_text_id: @text.id,
- submission_file_id: params[:submission_file_id],
+ submission_file_id: @submission_file_id,
x1: Integer(params[:x1]), x2: Integer(params[:x2]),
y1: Integer(params[:y1]), y2: Integer(params[:y2]),
is_remark: is_remark,
Something went wrong with that request. Please try again.