Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Commit

Permalink
Fetch CreatorCredit for Book/Edition on get_by_id()
Browse files Browse the repository at this point in the history
  • Loading branch information
leftmostcat committed Jun 11, 2014
1 parent 2a818b3 commit 8101840
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions data/book.js
Expand Up @@ -19,6 +19,13 @@ Book._columns = [
'book_data.comment'
];

Book.get_by_id = function(id) {
var book = CoreEntity.get_by_id.call(this, id);
book.creator_credit = CreatorCredit.get_by_id(book.creator_credit_id);

return book;
};

Book._build_search_body = function(data) {
var body = CoreEntity._build_search_body.call(this, data);

Expand Down
7 changes: 7 additions & 0 deletions data/edition.js
Expand Up @@ -26,6 +26,13 @@ Edition._columns = [
'edition_data.comment'
];

Edition.get_by_id = function(id) {
var edition = CoreEntity.get_by_id.call(this, id);
edition.creator_credit = CreatorCredit.get_by_id(edition.creator_credit_id);

return edition;
};

Edition._build_search_body = function(data) {
var body = CoreEntity._build_search_body.call(this, data);

Expand Down

0 comments on commit 8101840

Please sign in to comment.