lib/pg_search/tasks.rb in pg_search-1.0.4 vs lib/pg_search/tasks.rb in pg_search-1.0.5
- old
+ new
@@ -2,10 +2,10 @@
require 'pg_search'
namespace :pg_search do
namespace :multisearch do
desc "Rebuild PgSearch multisearch records for a given model"
- task :rebuild, [:model,:schema] => :environment do |task, args|
+ task :rebuild, [:model,:schema] => :environment do |_task, args|
raise ArgumentError, <<-MESSAGE.strip_heredoc unless args.model
You must pass a model as an argument.
Example: rake pg_search:multisearch:rebuild[BlogPost]
MESSAGE
model_class = args.model.classify.constantize