summaryrefslogtreecommitdiff
path: root/app/controllers/admin/photos_controller.rb
blob: c34189bc522513616a513dcc4c07258904008399 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module Admin
  class PhotosController < AdminController
    def initialize(photo_repository = Photo, storage = Spank::IOC.resolve(:blob_storage))
      @photo_repository = photo_repository
      @storage = storage
      super()
    end

    def index
      @photos = paginate(@photo_repository.order(id: :desc))
    end

    def show
      @photo = @photo_repository.find(params[:id])
    end

    def update
      ReProcessPhotoJob.perform_later(@photo_repository.find(params[:id]))
      redirect_to admin_photos_path
    end
  end
end