Skip to content

Commit

Permalink
Adding required classes in psych load (#92)
Browse files Browse the repository at this point in the history
* Adding time in permitted classes

* fixed failing specs
  • Loading branch information
HassanAkbar authored Dec 12, 2023
1 parent 61f6129 commit e0d857d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/glossarist/concept_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def save_to_files(managed_concepts)
end

def load_concept_from_file(filename)
concept_hash = Psych.safe_load(File.read(filename), permitted_classes: [Date])
concept_hash = Psych.safe_load(File.read(filename), permitted_classes: [Date, Time])
concept_hash["uuid"] = concept_hash["id"] || File.basename(filename, ".*")

concept = ManagedConcept.new(concept_hash)
Expand All @@ -50,7 +50,7 @@ def load_concept_from_file(filename)
def load_localized_concept(id)
concept_hash = Psych.safe_load(
File.read(localized_concept_path(id)),
permitted_classes: [Date],
permitted_classes: [Date, Time],
)
concept_hash["uuid"] = id

Expand Down
4 changes: 2 additions & 2 deletions spec/fixtures/relaton_cache/iso/iso_ts_14812_2022.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<bibdata type="standard" schema-version="v1.2.5">
<fetched>2023-11-28</fetched>
<bibdata type="standard" schema-version="v1.2.7">
<fetched>2023-12-12</fetched>
<title type="title-intro" format="text/plain" language="en" script="Latn">Intelligent transport systems</title>
<title type="title-main" format="text/plain" language="en" script="Latn">Vocabulary</title>
<title type="main" format="text/plain" language="en" script="Latn">Intelligent transport systems - Vocabulary</title>
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/relaton_cache/iso/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4ff4ff47a5e6abfaa3277f5a26f1707f
a03026b6e0501d55c0b281625ab5eb34

0 comments on commit e0d857d

Please sign in to comment.