Skip to content

Commit

Permalink
Merge pull request #410 from datacite/bugfix_nilClass
Browse files Browse the repository at this point in the history
Bugfix nil class
  • Loading branch information
sarala authored Feb 6, 2020
2 parents eff9561 + 54fee7e commit 1ca0af5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/serializers/activity_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class ActivitySerializer
end

attribute "prov:wasAttributedTo" do |object|
return nil if object.username.blank?

url = Rails.env.production? ? "https://api.datacite.org" : "https://api.test.datacite.org"
object.username.include?(".") ? url + "/clients/" + object.username : url + "/providers/" + object.username
end
Expand Down
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,4 @@
add_foreign_key "dataset", "datacentre", column: "datacentre", name: "FK5605B47847B5F5FF"
add_foreign_key "media", "dataset", column: "dataset", name: "FK62F6FE44D3D6B1B"
add_foreign_key "metadata", "dataset", column: "dataset", name: "FKE52D7B2F4D3D6B1B"
end
end

0 comments on commit 1ca0af5

Please sign in to comment.