Sha256: 3192bee5c0df39940a2bd2bce0257c77c567fbd89bfe6661117fd63d282ff3cb

Contents?: true

Size: 334 Bytes

Versions: 24

Compression:

Stored size: 334 Bytes

Contents

namespace :db_memoize do
  desc "wipes all currently memoized values (pass 'class=Product') to filter by class name"
  task clear: :environment do
    scope = DbMemoize::Value.all

    if klass_name = ENV['class']
      scope = scope.where(entity_table_name: klass_name.constantize.table_name)
    end

    scope.delete_all
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
db_memoize-0.4.0 lib/tasks/clear.rake
db_memoize-0.3.14 lib/tasks/clear.rake
db_memoize-0.3.13 lib/tasks/clear.rake
db_memoize-0.3.12 lib/tasks/clear.rake
db_memoize-0.3.11 lib/tasks/clear.rake
db_memoize-0.3.10 lib/tasks/clear.rake
db_memoize-0.3.9 lib/tasks/clear.rake
db_memoize-0.3.8 lib/tasks/clear.rake
db_memoize-0.3.7 lib/tasks/clear.rake
db_memoize-0.3.6 lib/tasks/clear.rake
db_memoize-0.3.5 lib/tasks/clear.rake
db_memoize-0.3.4 lib/tasks/clear.rake
db_memoize-0.3.3 lib/tasks/clear.rake
db_memoize-0.3.2 lib/tasks/clear.rake
db_memoize-0.2.3 lib/tasks/clear.rake
db_memoize-0.2.2 lib/tasks/clear.rake
db_memoize-0.2.1 lib/tasks/clear.rake
db_memoize-0.1.6 lib/tasks/clear.rake
db_memoize-0.1.5 lib/tasks/clear.rake
db_memoize-0.1.4 lib/tasks/clear.rake