Skip to content

Commit

Permalink
Merge pull request #2316 from openstax/drop_method
Browse files Browse the repository at this point in the history
Renamed dropped_method to drop_method
  • Loading branch information
Dantemss authored May 14, 2021
2 parents da1dba9 + bca0508 commit 1c7c428
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion app/representers/api/v1/tasks/tasked_exercise_representer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,16 @@ class TaskedExerciseRepresenter < TaskStepRepresenter
writeable: false,
if: FEEDBACK_AVAILABLE

property :dropped_method,
property :drop_method,
type: String,
readable: true,
writeable: false

# TODO: Remove after 1 release
property :dropped_method,
type: String,
readable: true,
writeable: false,
getter: ->(*) { drop_method }
end
end
2 changes: 1 addition & 1 deletion app/subsystems/tasks/models/tasked_exercise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def published_comments
end
end

def dropped_method
def drop_method
dropped_question = task_step.task&.task_plan&.dropped_questions&.find do |dq|
dq.question_id == question_id
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
allow(exercise).to receive(:published_late_work_point_penalty).and_return(0.25)
allow(exercise).to receive(:published_points).and_return(0.5)
allow(exercise).to receive(:published_comments).and_return('Hi')
allow(exercise).to receive(:dropped_method).and_return(nil)
allow(exercise).to receive(:drop_method).and_return(nil)
allow(exercise).to receive(:cache_key).and_return('tasks/models/tasked_exercises/42')
allow(exercise).to receive(:cache_version).and_return('test')
end
Expand Down

0 comments on commit 1c7c428

Please sign in to comment.