Use boolean comparators where it makes sense
This commit is contained in:
parent
dbdc7ae4aa
commit
118886344a
28 changed files with 60 additions and 60 deletions
|
|
@ -10,7 +10,7 @@ class MessagesController < ApplicationController
|
|||
# Creates a new message object.
|
||||
def new
|
||||
@message = Message.new(params[:message])
|
||||
if @message.reply_to and not @message.reply_to.is_readable_for?(current_user)
|
||||
if @message.reply_to && !@message.reply_to.is_readable_for?(current_user)
|
||||
redirect_to new_message_url, alert: 'Nachricht ist privat!'
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ module FoodsoftMessages
|
|||
|
||||
# modify user presentation link to writing a message for the user
|
||||
def show_user_link(user=@current_user)
|
||||
if user.nil? or not FoodsoftMessages.enabled?
|
||||
if user.nil? || !FoodsoftMessages.enabled?
|
||||
show_user user
|
||||
else
|
||||
link_to show_user(user), new_message_path('message[mail_to]' => user.id),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue