Use boolean comparators where it makes sense

This commit is contained in:
wvengen 2015-01-14 21:15:08 +01:00
parent dbdc7ae4aa
commit 118886344a
28 changed files with 60 additions and 60 deletions

View file

@ -84,7 +84,7 @@ class PagesController < ApplicationController
else
if @page.save
@page.parent_id = parent_id if (!params[:parent_id].blank? \
and params[:parent_id] != @page_id)
&& params[:parent_id] != @page_id)
flash[:notice] = I18n.t('pages.update.notice')
redirect_to wiki_page_path(@page.permalink)
else

View file

@ -62,7 +62,7 @@ module PagesHelper
def parent_pages_to_select(current_page)
unless current_page.homepage? # Homepage is the page trees root!
Page.non_redirected.reject { |p| p == current_page or p.ancestors.include?(current_page) }
Page.non_redirected.reject { |p| p == current_page || p.ancestors.include?(current_page) }
else
Array.new
end

View file

@ -1,7 +1,7 @@
- content = wikified_body @page.body, @page.title
- toc = generate_toc @page.body
- unless toc.blank? or params[:preview]
- unless toc.blank? || params[:preview]
- content_for :sidebar do
#wikitoc.well.well-small
%h3= t '.title_toc'