summaryrefslogtreecommitdiff
path: root/app/controllers/v1/messages_controller.rb
diff options
context:
space:
mode:
authorazul <azul@riseup.net>2014-04-25 12:15:37 +0200
committerazul <azul@riseup.net>2014-04-25 12:15:37 +0200
commit76ad25ba0ee344f185f8e8cdfe066685cd3b0447 (patch)
treed8122b5b5144c917f5e1924c1428a3a871e94149 /app/controllers/v1/messages_controller.rb
parent2b6200f508ddb8e1c8a76fd3778881c39d787d8d (diff)
parentbe81b7430e0a2046125be7c3a4b01b8725f4afe6 (diff)
Merge pull request #148 from azul/feature/api-quota-support
Feature/api quota support + current_user null pattern
Diffstat (limited to 'app/controllers/v1/messages_controller.rb')
-rw-r--r--app/controllers/v1/messages_controller.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/controllers/v1/messages_controller.rb b/app/controllers/v1/messages_controller.rb
index f71d0f1..85156b7 100644
--- a/app/controllers/v1/messages_controller.rb
+++ b/app/controllers/v1/messages_controller.rb
@@ -7,12 +7,11 @@ module V1
respond_to :json
def index
- render json: (current_user ? current_user.messages : [] )
+ render json: current_user.messages
end
def update
- message = Message.find(params[:id])
- if (message and current_user)
+ if message = Message.find(params[:id])
message.mark_as_read_by(current_user)
message.save
render json: true