Skip to content

Commit

Permalink
Merge pull request #46 from Scalingo/fix/44/database-backups-create-u…
Browse files Browse the repository at this point in the history
…npack-response

fix(backups#restore): Unpack response from backups#restore properly
  • Loading branch information
aurelien-reeves-scalingo authored Jan 3, 2023
2 parents 7386d6f + 905a37d commit 65bc6fe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Unreleased

* Bugfix: response of Backups#create was not properly unpacked ([#44](https://github.com/Scalingo/scalingo-ruby-api/issues/44))

## 3.2.0 - 2022-12-23

* Removal: `Scalingo::Client#agora_fr1` had been removed since the region no longer exists.
Expand Down
2 changes: 1 addition & 1 deletion lib/scalingo/regional_database/backups.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def create(addon_id, headers = nil, &block)
&block
)

unpack { response }
unpack(:database_backup) { response }
end

def for(addon_id, headers = nil, &block)
Expand Down
16 changes: 9 additions & 7 deletions samples/regional_database/backups/create-201.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
"Referrer-Policy": "strict-origin-when-cross-origin"
},
"json_body": {
"id": "5b8b36104ffb090be1ac3ce1",
"created_at": "2019-07-18T03:00:00.178+02:00",
"name": "20180902010000_kibana-3938",
"size": 0,
"status": "pending",
"database_id": "597601234ffb097af4f3099b",
"type": "postgresql"
"database_backup": {
"id": "5b8b36104ffb090be1ac3ce1",
"created_at": "2019-07-18T03:00:00.178+02:00",
"name": "20180902010000_kibana-3938",
"size": 0,
"status": "pending",
"database_id": "597601234ffb097af4f3099b",
"type": "postgresql"
}
}
}
}

0 comments on commit 65bc6fe

Please sign in to comment.