Sha256: 9e38cf73d2187ba968a5537ff1341630f52d3ed379ad23c6d2edc9aecd20e9bb

Contents?: true

Size: 426 Bytes

Versions: 3

Compression:

Stored size: 426 Bytes

Contents

namespace :searchcraft do
  desc "Refresh searchcraft materialized views"
  task refresh: :environment do
    SearchCraft::Builder.rebuild_any_if_changed!
    require "benchmark"
    SearchCraft.config.explicit_model_class_names.each do |model_class_name|
      klass = model_class_name.constantize
      warn "Refreshing materialized views for #{klass.name}"
      puts Benchmark.measure { klass.refresh! }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
searchcraft-0.5.2 lib/tasks/refresh.rake
searchcraft-0.5.1 lib/tasks/refresh.rake
searchcraft-0.5.0 lib/tasks/refresh.rake