diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb index ee8edc94..2c49569d 100644 --- a/app/controllers/items_controller.rb +++ b/app/controllers/items_controller.rb @@ -37,9 +37,8 @@ class ItemsController < ApplicationController end end elsif params.has_key?(:ids) && params[:ids].is_a?(Array) - @items = Item.build_proxies(params[:ids]) + @items = Item.find(params[:ids]) assign_closeted! - @items.prepare_method(:as_json) respond_to do |format| format.json { render json: @items } end diff --git a/app/models/item/update_task.rb b/app/models/item/update_task.rb deleted file mode 100644 index ce986760..00000000 --- a/app/models/item/update_task.rb +++ /dev/null @@ -1,22 +0,0 @@ -class Item - class UpdateTask - extend FragmentExpiration - - TIMEOUT_IN_SECONDS = 10 - - @queue = :item_update - - def self.perform(id) - Timeout::timeout(TIMEOUT_IN_SECONDS) do - item = Item.find(id) - expire_cache_for(item) - end - end - - private - - def self.expire_cache_for(item) - expire_key_in_all_locales("items/#{item.id}#as_json") - end - end -end \ No newline at end of file diff --git a/app/models/item_observer.rb b/app/models/item_observer.rb index c9e421db..a3ac5eb5 100644 --- a/app/models/item_observer.rb +++ b/app/models/item_observer.rb @@ -2,11 +2,6 @@ class ItemObserver < ActionController::Caching::Sweeper def after_create(item) Resque.enqueue(Item::CreateTask, item.id) end - - def after_update(item) - # CONSIDER: can pass item.changes.keys in to choose which caches to expire - Resque.enqueue(Item::UpdateTask, item.id) - end def after_destroy(item) Resque.enqueue(Item::DestroyTask, item.id)