Skip to content

Commit ad6c2e0

Browse files
shimeestolfo
authored andcommitted
[RAILS] Fix seeds file to stop using outdated YAML method (elastic#843)
The expert template was using the outdated YAML.load_documents, which is no longer present in the newer versions of Ruby.
1 parent 6f08608 commit ad6c2e0

File tree

1 file changed

+2
-1
lines changed
  • elasticsearch-rails/lib/rails/templates

1 file changed

+2
-1
lines changed

elasticsearch-rails/lib/rails/templates/seeds.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
Zlib::GzipReader.open(File.expand_path('../articles.yml.gz', __FILE__)) do |gzip|
55
puts "Reading articles from gzipped YAML..."
6-
@documents = YAML.load_documents(gzip.read)
6+
@documents = YAML.respond_to?(:load_documents) ? YAML.load_documents(gzip.read) :
7+
YAML.load_stream(gzip.read)
78
end
89

910
# Truncate the default ActiveRecord logger output

0 commit comments

Comments
 (0)