diff options
| author | mo khan <mo@mokhan.ca> | 2014-10-16 20:43:15 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-10-16 20:43:15 -0600 |
| commit | 4eb7dd4fb2ed71006aee665ae7f666ee88d44c22 (patch) | |
| tree | e97551e8248a239a958fe7d2a7ff9bea5e75e183 /app/controllers | |
| parent | f2eef36abce2148fe044b6dbda85fadf77754019 (diff) | |
remove usage of find cake by id query object.
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/creations_controller.rb | 8 | ||||
| -rw-r--r-- | app/controllers/favorites_controller.rb | 2 |
2 files changed, 3 insertions, 7 deletions
diff --git a/app/controllers/creations_controller.rb b/app/controllers/creations_controller.rb index 6db6b203..618d9986 100644 --- a/app/controllers/creations_controller.rb +++ b/app/controllers/creations_controller.rb @@ -4,11 +4,7 @@ class CreationsController < ApplicationController end def show - @creation = FindCreationQuery.new.fetch(params[:id]) - if params[:photo_id].present? - @primary_image = @creation.photos.find(params[:photo_id]) - else - @primary_image = @creation.primary_image - end + @creation = Creation.find(params[:id]) + @primary_image = params[:photo_id].present? ? @creation.photos.find(params[:photo_id]) : @creation.primary_image end end diff --git a/app/controllers/favorites_controller.rb b/app/controllers/favorites_controller.rb index b3986845..830ed6c9 100644 --- a/app/controllers/favorites_controller.rb +++ b/app/controllers/favorites_controller.rb @@ -7,7 +7,7 @@ class FavoritesController < ApplicationController end def index - @creation = FindCreationQuery.new.fetch(params[:creation_id]) + @creation = Creation.find(params[:creation_id]) @favorites = @creation.favorites end |
