Skip to content

Commit

Permalink
Merge pull request #2209 from sul-dlss/2208-multivalued-struct
Browse files Browse the repository at this point in the history
Struct fields from solr may be multivalued; fixes #2208
  • Loading branch information
Jessie Keck committed Nov 22, 2018
2 parents a8143d3 + 9c80077 commit 37122fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/concerns/schema_dot_org.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def schema_dot_org?
end

def as_schema_dot_org
self[:schema_dot_org_struct] || solr_values_to_schema_dot_org
Array(self[:schema_dot_org_struct]).first || solr_values_to_schema_dot_org
end

def solr_values_to_schema_dot_org
Expand Down
2 changes: 1 addition & 1 deletion spec/models/concerns/schema_dot_org_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

RSpec.describe SchemaDotOrg do
context 'with data serialized into the solr document' do
let(:document) { SolrDocument.new(schema_dot_org_struct: { schema: '.org' }) }
let(:document) { SolrDocument.new(schema_dot_org_struct: [{ schema: '.org' }]) }

it 'uses that data' do
expect(document).to be_schema_dot_org
Expand Down

0 comments on commit 37122fd

Please sign in to comment.