Skip to content

Commit

Permalink
use openstruct for repository. datacite/datacite#336
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Sep 23, 2018
1 parent dc77071 commit f677b21
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def repository_id=(value)
end

def repository
cached_repository_response(re3data) if re3data.present?
OpenStruct.new(cached_repository_response(re3data)) if re3data.present?
end

def target_id=(value)
Expand Down
2 changes: 1 addition & 1 deletion app/serializers/client_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class ClientSerializer
set_key_transform :dash
set_type :clients
set_id :uid
#cache_options enabled: true, cache_length: 24.hours
cache_options enabled: true, cache_length: 24.hours

attributes :name, :symbol, :year, :contact_name, :contact_email, :domains, :url, :created, :updated

Expand Down
2 changes: 1 addition & 1 deletion app/serializers/repository_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class RepositorySerializer
include FastJsonapi::ObjectSerializer
set_key_transform :dash
set_type :repositories
#cache_options enabled: true, cache_length: 24.hours
cache_options enabled: true, cache_length: 24.hours

attributes :repository_name, :repository_url, :repository_contacts, :description, :certificates, :types,
:additional_names, :subjects, :content_types, :provider_types,
Expand Down

0 comments on commit f677b21

Please sign in to comment.