MR discussions doesn't load when it has `LegacyDiffDiscussion`
While working on implementing a new GitHub import QA scenario, I got an error (https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/19555#note_84023971) when trying to assert a discussions was imported.
It seems discussion fail to load because LegacyDiffDiscussion
doesn't have a position
:
NoMethodError - DiscussionEntity missing attribute `position' on #<LegacyDiffDiscussion:0x00007fc051ea2a68>:
grape-entity (0.7.1) lib/grape_entity/exposure/base.rb:57:in `valid?'
grape-entity (0.7.1) lib/grape_entity/exposure/base.rb:82:in `valid_value'
grape-entity (0.7.1) lib/grape_entity/exposure/base.rb:66:in `serializable_value'
grape-entity (0.7.1) lib/grape_entity/exposure/nesting_exposure.rb:41:in `block in serializable_value'
grape-entity (0.7.1) lib/grape_entity/exposure/nesting_exposure.rb:120:in `block (2 levels) in map_entity_exposures'
grape-entity (0.7.1) lib/grape_entity/exposure/base.rb:116:in `block in with_attr_path'
grape-entity (0.7.1) lib/grape_entity/options.rb:90:in `with_attr_path'
grape-entity (0.7.1) lib/grape_entity/exposure/base.rb:115:in `with_attr_path'
grape-entity (0.7.1) lib/grape_entity/exposure/nesting_exposure.rb:119:in `block in map_entity_exposures'
grape-entity (0.7.1) lib/grape_entity/exposure/nesting_exposure.rb:118:in `map_entity_exposures'
grape-entity (0.7.1) lib/grape_entity/exposure/nesting_exposure.rb:40:in `serializable_value'
grape-entity (0.7.1) lib/grape_entity/entity.rb:489:in `serializable_hash'
activesupport (4.2.10) lib/active_support/core_ext/object/json.rb:140:in `block in as_json'
activesupport (4.2.10) lib/active_support/core_ext/object/json.rb:140:in `as_json'
app/serializers/base_serializer.rb:14:in `represent'
app/controllers/concerns/issuable_actions.rb:103:in `discussions'
/cc @felipe_artur