Skip to content

Commit

Permalink
Add collection_id to media_object JSON response
Browse files Browse the repository at this point in the history
  • Loading branch information
masaball committed Feb 27, 2024
1 parent 3d9bd82 commit f1d56ce
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 f1d56ce

Please sign in to comment.