app/models/concerns/spotlight/resources/open_graph.rb in blacklight-spotlight-0.23.0 vs app/models/concerns/spotlight/resources/open_graph.rb in blacklight-spotlight-0.24.0
- old
+ new
@@ -18,11 +18,21 @@
end
end
def opengraph_properties
Hash[opengraph.map do |k, v|
- ["#{k.parameterize('_')}_tesim", v]
+ ["#{opengraph_solr_field_name(k)}_tesim", v]
end]
+ end
+
+ private
+
+ def opengraph_solr_field_name(field)
+ if Rails::VERSION::MAJOR >= 5
+ field.parameterize(separator: '_')
+ else
+ field.parameterize('_')
+ end
end
end
end
end