Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/datacite/lupo
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Apr 22, 2021
2 parents 4e00a1d + 903f6b5 commit ca479a6
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
14 changes: 7 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ GEM
audited (4.10.0)
activerecord (>= 4.2, < 6.2)
aws-eventstream (1.1.1)
aws-partitions (1.444.0)
aws-partitions (1.446.0)
aws-sdk-core (3.114.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
Expand Down Expand Up @@ -102,7 +102,7 @@ GEM
latex-decode (~> 0.0)
binding_of_caller (1.0.0)
debug_inspector (>= 0.0.1)
bolognese (1.9.4)
bolognese (1.9.5)
activesupport (>= 4.2.5)
benchmark_methods (~> 0.7)
bibtex-ruby (>= 5.1.0)
Expand Down Expand Up @@ -156,7 +156,7 @@ GEM
commonmarker (0.17.13)
ruby-enum (~> 0.5)
concurrent-ruby (1.1.8)
connection_pool (2.2.4)
connection_pool (2.2.5)
countries (2.1.4)
i18n_data (~> 0.8.0)
money (~> 6.9)
Expand Down Expand Up @@ -296,7 +296,7 @@ GEM
jsonlint (0.3.0)
oj (~> 3)
optimist (~> 3)
jwt (2.2.2)
jwt (2.2.3)
kaminari (1.2.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.1)
Expand Down Expand Up @@ -374,7 +374,7 @@ GEM
nokogiri (1.11.3)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
oj (3.11.3)
oj (3.11.5)
oj_mimic_json (1.0.1)
optimist (3.0.1)
pandoc-ruby (2.1.4)
Expand All @@ -385,7 +385,7 @@ GEM
addressable (>= 2.4.0)
nokogiri (>= 1.8.0)
public_suffix (>= 2.0.0, < 2.1)
premailer (1.14.2)
premailer (1.14.3)
addressable
css_parser (>= 1.6.0)
htmlentities (>= 4.0.0)
Expand Down Expand Up @@ -496,7 +496,7 @@ GEM
rspec-mocks (~> 3.9.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.4)
rubocop (1.12.1)
rubocop (1.13.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
Expand Down
1 change: 1 addition & 0 deletions app/controllers/datacite_dois_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,7 @@ def safe_params
dates
identifiers
relatedIdentifiers
relatedItems
fundingReferences
geoLocations
rightsList
Expand Down
11 changes: 1 addition & 10 deletions app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class Doi < ApplicationRecord
validate :check_landing_page, if: :landing_page?
validate :check_identifiers, if: :identifiers?
validate :check_related_identifiers, if: :related_identifiers?
# validate :check_related_items, if: :related_items?
validate :check_related_items, if: :related_items?
validate :check_funding_references, if: :funding_references?
validate :check_geo_locations, if: :geo_locations?
validate :check_language, if: :language?
Expand Down Expand Up @@ -1656,15 +1656,6 @@ def identifier
normalize_doi(doi, sandbox: !Rails.env.production?)
end

# disable virtual attributes when database has been migrated
def related_items=(value)
write_attribute(:related_items, value) if has_attribute?(:related_items)
end

def related_items
read_attribute(:related_items) if has_attribute?(:related_items)
end

def client_id
client.symbol.downcase if client.present?
end
Expand Down
16 changes: 16 additions & 0 deletions spec/factories/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,22 @@
},
]
end
related_items do
[
{
"firstPage" => "249",
"lastPage" => "264",
"publicationYear" => "2018",
"relatedItemIdentifier" =>
{ "__content__" => "10.1016/j.physletb.2017.11.044",
"relatedItemIdentifierType" => "DOI" },
"relatedItemType" => "Journal",
"relationType" => "IsPublishedIn",
"titles" => { "title" => "Physics letters / B" },
"volume" => "776"
}
]
end
schema_version { "http://datacite.org/schema/kernel-4" }
source { "test" }
type { "DataciteDoi" }
Expand Down

0 comments on commit ca479a6

Please sign in to comment.