Sha256: 9baef37e8849a278b402cd7b1cfc2865ae83b18c231f03331e67b24d7fff54fc

Contents?: true

Size: 495 Bytes

Versions: 8

Compression:

Stored size: 495 Bytes

Contents

require 'rake'
require 'pg_search'

namespace :pg_search do
  namespace :multisearch do
    desc "Rebuild PgSearch multisearch records for a given model"
    task :rebuild, [:model] => :environment do |task, args|
      raise ArgumentError, <<-MESSAGE 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
      PgSearch::Multisearch.rebuild(model_class)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pg_search-0.5.7 lib/pg_search/tasks.rb
pg_search-0.5.6 lib/pg_search/tasks.rb
pg_search-0.5.5 lib/pg_search/tasks.rb
pg_search-0.5.4 lib/pg_search/tasks.rb
pg_search-0.5.3 lib/pg_search/tasks.rb
pg_search-0.5.2 lib/pg_search/tasks.rb
pg_search-0.5.1 lib/pg_search/tasks.rb
pg_search-0.5 lib/pg_search/tasks.rb