Skip to content

Commit

Permalink
Merge pull request #5699 from avalonmediasystem/mo_collection_id_json
Browse files Browse the repository at this point in the history
Add collection_id to media_object JSON response
  • Loading branch information
masaball authored Feb 28, 2024
2 parents b52b35a + f1d56ce commit 0ac5593
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/models/concerns/media_object_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def as_json(options={})
id: id,
title: title,
collection: collection.name,
collection_id: collection.id,
unit: collection.unit,
main_contributors: creator,
publication_date: date_created,
Expand Down
1 change: 1 addition & 0 deletions spec/controllers/media_objects_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,7 @@
expect(json['id']).to eq(media_object.id)
expect(json['title']).to eq(media_object.title)
expect(json['collection']).to eq(media_object.collection.name)
expect(json['collection_id']).to eq(media_object.collection.id)
expect(json['main_contributors']).to eq(media_object.creator)
expect(json['publication_date']).to eq(media_object.date_created)
expect(json['published_by']).to eq(media_object.avalon_publisher)
Expand Down

0 comments on commit 0ac5593

Please sign in to comment.