diff options
author | jessib <jessib@riseup.net> | 2014-01-09 12:18:37 -0800 |
---|---|---|
committer | jessib <jessib@riseup.net> | 2014-01-09 12:18:37 -0800 |
commit | 6c478c5a1634b5da9d269c938f67d2ac4d8f03df (patch) | |
tree | 4a7667b0061da13b56a9ba13f7976ed2a137bb2a /users/app/controllers/v1 | |
parent | 90243155b425a540cb357f1c84b93effe798c9a1 (diff) |
Some more cleanup, but still want to make sure by_user_ids_to_show_and_created_at view is right before issuing pull request.
Diffstat (limited to 'users/app/controllers/v1')
-rw-r--r-- | users/app/controllers/v1/messages_controller.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/users/app/controllers/v1/messages_controller.rb b/users/app/controllers/v1/messages_controller.rb index 371b83e..1b994ca 100644 --- a/users/app/controllers/v1/messages_controller.rb +++ b/users/app/controllers/v1/messages_controller.rb @@ -14,8 +14,9 @@ module V1 message = Message.find(params[:id]) if (message and current_user) message.user_ids_to_show.delete(current_user.id) - # is it necessary to keep track of what users have already seen it?: - message.user_ids_have_shown << current_user.id if !message.user_ids_have_shown.include?(current_user.id) #TODO: is it quicker to instead call uniq! after adding? + # is it necessary to keep track of what users have already seen it? + message.user_ids_have_shown << current_user.id if !message.user_ids_have_shown.include?(current_user.id) + # TODO: is it quicker to call uniq! after adding rather than check if it is already included? message.save render json: true else |