Skip to content

Commit

Permalink
Fix issue with updating logo
Browse files Browse the repository at this point in the history
  • Loading branch information
Ed Tewiah committed Feb 7, 2018
1 parent 86fdab6 commit 725b307
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
* Add support for facebook authentication using omniauth
* Fix issue with sending emails (#48)
* Add Polish and Romanian translations
* Fix issue with updating logo

## 1.3.0 / 2017-12-04

Expand Down
7 changes: 6 additions & 1 deletion app/controllers/pwb/api/v1/web_contents_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ def update_photo
# where photo has never been set before, associated Content will not exist
content = Content.find_by_key(content_tag) || Content.create({ key: content_tag, tag: 'appearance' })
photo = ContentPhoto.create
if content_tag == "logo"
# TODO: This is a workaround
# need to have a way of determining content that should only have
# one photo and enforcing that
content.content_photos.destroy_all
end
content.content_photos.push photo
end
# TODO: - handle where no photo or content_tag..
end

if params[:file]
photo.image = params[:file]
end
Expand Down

0 comments on commit 725b307

Please sign in to comment.