Convert `.from_json_hash` into alias of `.from_api_response` GitHub importer representations
Summary
All files lib/gitlab/github_import/representation/**/*.rb
have two methods currently:
-
.from_api_response
which is used to init instance by data we received from GitHub API client. -
.from_json_hash
which is used to init instance by data that we received from worker args.
The point is that those methods were different because data from GitHub API client came as an instance of Sawyer resource. But currently it doesn't and come as hash instance in both cases because we don't use Sawyer since Convert Sawyer Resource records to hash. Although it doesn't mean that in all cases such methods works identically now. But in some of them - yes.
So, the target of this issue is to remove .from_json_hash
and put it as an alias to .from_api_response
where it's possible. Also play with specs for DRY.
Edited by Rostyslav Safonov