Skip to content

Commit bed03ec

Browse files
committed
Address Naming/MethodParameterName offences
- This change addresses the following rubocop offences: ``` app/controllers/answers_controller.rb:125:43: C: Naming/MethodParameterName: Method parameter must be at least 3 characters long. def handle_answer_transaction(p_params, q) ^ app/controllers/answers_controller.rb:144:27: C: Naming/MethodParameterName: Method parameter must be at least 3 characters long. def create_answer(args, q, standards) ^ app/controllers/answers_controller.rb:156:27: C: Naming/MethodParameterName: Method parameter must be at least 3 characters long. def update_answer(args, q, standards) ```
1 parent a840abb commit bed03ec

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

app/controllers/answers_controller.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def create_or_update
122122

123123
private
124124

125-
def handle_answer_transaction(p_params, q)
125+
def handle_answer_transaction(p_params, question)
126126
Answer.transaction do
127127
args = p_params
128128
# Answer model does not understand :standards so remove it from the params
@@ -133,27 +133,27 @@ def handle_answer_transaction(p_params, q)
133133
plan_id: args[:plan_id],
134134
question_id: args[:question_id]
135135
)
136-
update_answer(args, q, standards)
136+
update_answer(args, question, standards)
137137
rescue ActiveRecord::RecordNotFound
138-
create_answer(args, q, standards)
138+
create_answer(args, question, standards)
139139
rescue ActiveRecord::StaleObjectError
140140
handle_stale_answer_error(args)
141141
end
142142
end
143143

144-
def create_answer(args, q, standards)
144+
def create_answer(args, question, standards)
145145
@answer = Answer.new(args.merge(user_id: current_user.id))
146146
@answer.lock_version = 1
147147
authorize @answer
148-
if q.question_format.rda_metadata?
148+
if question.question_format.rda_metadata?
149149
@answer.update_answer_hash(
150150
JSON.parse(standards.to_json), args[:text]
151151
)
152152
end
153153
@answer.save!
154154
end
155155

156-
def update_answer(args, q, standards)
156+
def update_answer(args, question, standards)
157157
authorize @answer
158158

159159
@answer.update(args.merge(user_id: current_user.id))
@@ -162,7 +162,7 @@ def update_answer(args, q, standards)
162162
# Needed if only answer.question_options is updated
163163
@answer.touch
164164
end
165-
return unless q.question_format.rda_metadata?
165+
return unless question.question_format.rda_metadata?
166166

167167
@answer.update_answer_hash(
168168
JSON.parse(standards.to_json), args[:text]

0 commit comments

Comments
 (0)