Skip to content

Commit 4428d1e

Browse files
committedSep 15, 2014
[RAILS] Fixed an error in import Rake task
When the task was called without arguments, it failed because `import_model_desc` was nil
1 parent 7735f18 commit 4428d1e

File tree

1 file changed

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

1 file changed

+2
-1
lines changed
 

‎elasticsearch-rails/lib/elasticsearch/rails/tasks/import.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
task :import => 'import:model'
2323

2424
namespace :import do
25-
desc <<-DESC.gsub(/ /, '')
25+
import_model_desc = <<-DESC.gsub(/ /, '')
2626
Import data from your model (pass name as CLASS environment variable).
2727
2828
$ rake environment elasticsearch:import:model CLASS='MyModel'
@@ -39,6 +39,7 @@
3939
Pass an ActiveRecord scope to limit the imported records:
4040
$ rake environment elasticsearch:import:model CLASS='Article' SCOPE='published'
4141
DESC
42+
desc import_model_desc
4243
task :model do
4344
if ENV['CLASS'].to_s == ''
4445
puts '='*90, 'USAGE', '='*90, import_model_desc, ""

0 commit comments

Comments
 (0)
Please sign in to comment.