-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #271 from fablabbcn/bugfix/always-send-profile-pic…
…ture-with-user Move all avatars to profile_picture and ensure that profile_picture is included in responses
- Loading branch information
Showing
7 changed files
with
42 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# this file is required for errbit notifier | ||
class ApplicationController < ActionController::API | ||
include ActionController::ImplicitRender | ||
include ActionController::Helpers | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module UserHelper | ||
def profile_picture_url(user) | ||
if user.profile_picture.attached? | ||
polymorphic_url(user.profile_picture, only_path: false) | ||
else | ||
'' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1 @@ | ||
json.array! @devices, partial: 'device', as: :device | ||
|
||
# json.array! @devices do |device| | ||
# json.id device.id | ||
# json.name device.name | ||
# json.description device.description | ||
# json.status device.status | ||
# json.added_at device.added_at | ||
# json.last_reading_at device.last_reading_at | ||
# json.updated_at device.updated_at | ||
|
||
# json.kit_id device.kit_id | ||
|
||
# json.owner device.owner, :id, :username, :avatar, :url, :joined_at, :location, :device_ids | ||
# end | ||
json.array! @devices, partial: 'device', as: :device |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters