diff options
| author | mo khan <mo@mokhan.ca> | 2015-01-11 09:48:43 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2015-01-11 09:48:43 -0700 |
| commit | 50eaeae7ef98f66ed187ff8193d8b73dc390681b (patch) | |
| tree | 0794607f3a1f405834846aba7610bb00bc134654 /app/controllers | |
| parent | 4f316113ce7a18ab44cdf9213a147d5b96236929 (diff) | |
load processed photos.
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/api/v2/cakes_controller.rb | 6 | ||||
| -rw-r--r-- | app/controllers/api/v2/photos_controller.rb | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/app/controllers/api/v2/cakes_controller.rb b/app/controllers/api/v2/cakes_controller.rb index 4c85fd90..b683c1e6 100644 --- a/app/controllers/api/v2/cakes_controller.rb +++ b/app/controllers/api/v2/cakes_controller.rb @@ -1,17 +1,19 @@ module Api module V2 class CakesController < ApplicationController + attr_reader :repository + def initialize(repository = Spank::IOC.resolve(:cakes)) @repository = repository super() end def index - @cakes = paginate(@repository.search_with(params).includes(:category)) + @cakes = paginate(repository.search_with(params).includes(:category)) end def show(id = params[:id]) - @cake = @repository.find(id) + @cake = repository.find(id) end end end diff --git a/app/controllers/api/v2/photos_controller.rb b/app/controllers/api/v2/photos_controller.rb index c4240327..380f610c 100644 --- a/app/controllers/api/v2/photos_controller.rb +++ b/app/controllers/api/v2/photos_controller.rb @@ -2,7 +2,7 @@ module Api module V2 class PhotosController < ApplicationController def index - @photos = Photo.page(page).per(per_page) + @photos = paginate(Photo.processed) end def show(id = params[:id]) |
