A platform for community discussion. Free, open, simple.
DEV: Remove unused `transition_to` and `transition_to_id` from reviewable serializer (#37135)
Alan Guo Xiang Tan35f660e3a15b
diff --git a/app/serializers/reviewable_perform_result_serializer.rb b/app/serializers/reviewable_perform_result_serializer.rbindex 5850d344c50..b3f03025fad 100644--- a/app/serializers/reviewable_perform_result_serializer.rb+++ b/app/serializers/reviewable_perform_result_serializer.rb@@ -3,8 +3,6 @@class ReviewablePerformResultSerializer < ApplicationSerializerattributes(:success,- :transition_to,- :transition_to_id,:created_post_id,:created_post_topic_id,:remove_reviewable_ids,@@ -17,10 +15,6 @@ class ReviewablePerformResultSerializer < ApplicationSerializerobject.success?end- def transition_to_id- Reviewable.statuses[transition_to]- end-def versionobject.reviewable.versionenddiff --git a/spec/models/reviewable_spec.rb b/spec/models/reviewable_spec.rbindex b0a7f67ad92..33afebd9b1c 100644--- a/spec/models/reviewable_spec.rb+++ b/spec/models/reviewable_spec.rb@@ -498,8 +498,6 @@ RSpec.describe Reviewable, type: :model doexpect(messages.first.data).to eq({success: true,- transition_to: :approved,- transition_to_id: 1,created_post_id: perform_result.created_post.id,created_post_topic_id: perform_result.created_post_topic.id,remove_reviewable_ids: [reviewable.id],@@ -529,8 +527,6 @@ RSpec.describe Reviewable, type: :model doexpect(messages.first.data).to eq({success: true,- transition_to: :rejected,- transition_to_id: 2,remove_reviewable_ids: [reviewable.id],version: 1,reviewable_count: 0,diff --git a/spec/requests/reviewables_controller_spec.rb b/spec/requests/reviewables_controller_spec.rbindex 49a49dc32c4..39915418cd7 100644--- a/spec/requests/reviewables_controller_spec.rb+++ b/spec/requests/reviewables_controller_spec.rb@@ -631,10 +631,6 @@ RSpec.describe ReviewablesController dojson = response.parsed_bodyexpect(json["reviewable_perform_result"]["success"]).to eq(true)expect(json["reviewable_perform_result"]["version"]).to eq(1)- expect(json["reviewable_perform_result"]["transition_to"]).to eq("approved")- expect(json["reviewable_perform_result"]["transition_to_id"]).to eq(- Reviewable.statuses[:approved],- )expect(json["reviewable_perform_result"]["remove_reviewable_ids"]).to eq([reviewable.id])expect(json["reviewable_perform_result"]["reviewable_count"]).to eq(1)@@ -726,8 +722,6 @@ RSpec.describe ReviewablesController do"/reviewable_action",{success: true,- transition_to: :approved,- transition_to_id: 1,remove_reviewable_ids: [reviewable_phony.id],version: 1,reviewable_count: 0,