fixes spacing

This commit is contained in:
rgarcia
2015-08-16 22:45:43 +02:00
parent 57530926a1
commit bea38226fe
17 changed files with 72 additions and 72 deletions

View File

@@ -16,6 +16,7 @@ class AccountController < ApplicationController
end
private
def set_account
@account = current_user
end

View File

@@ -10,4 +10,4 @@ class Admin::BaseController < ApplicationController
raise CanCan::AccessDenied unless current_user.try(:administrator?)
end
end
end

View File

@@ -26,12 +26,12 @@ class Admin::TagsController < Admin::BaseController
private
def tag_params
params.require(:tag).permit(:featured, :name)
end
def tag_params
params.require(:tag).permit(:featured, :name)
end
def find_tag
@tag = ActsAsTaggableOn::Tag.find(params[:id])
end
def find_tag
@tag = ActsAsTaggableOn::Tag.find(params[:id])
end
end

View File

@@ -19,25 +19,25 @@ class ApplicationController < ActionController::Base
private
def set_locale
if params[:locale] && I18n.available_locales.include?(params[:locale].to_sym)
session[:locale] = params[:locale]
def set_locale
if params[:locale] && I18n.available_locales.include?(params[:locale].to_sym)
session[:locale] = params[:locale]
end
session[:locale] ||= I18n.default_locale
I18n.locale = session[:locale]
end
session[:locale] ||= I18n.default_locale
I18n.locale = session[:locale]
end
def set_layout
if devise_controller?
"devise"
else
"application"
def set_layout
if devise_controller?
"devise"
else
"application"
end
end
end
def set_debate_votes(debates)
@voted_values = current_user ? current_user.debate_votes(debates) : {}
end
def set_debate_votes(debates)
@voted_values = current_user ? current_user.debate_votes(debates) : {}
end
end

View File

@@ -22,6 +22,7 @@ class CommentsController < ApplicationController
end
private
def comment_params
params.require(:comments).permit(:commentable_type, :commentable_id, :body)
end

View File

@@ -48,6 +48,7 @@ class DebatesController < ApplicationController
private
def debate_params
params.require(:debate).permit(:title, :description, :tag_list, :terms_of_service, :captcha, :captcha_key)
end

View File

@@ -12,8 +12,8 @@ class RegistrationsController < Devise::RegistrationsController
private
def sign_up_params
params.require(:user).permit(:first_name, :last_name, :email, :password, :password_confirmation, :use_nickname, :nickname, :captcha, :captcha_key)
end
def sign_up_params
params.require(:user).permit(:first_name, :last_name, :email, :password, :password_confirmation, :use_nickname, :nickname, :captcha, :captcha_key)
end
end

View File

@@ -3,7 +3,7 @@ class Debate < ActiveRecord::Base
default_scope { order('created_at DESC') }
apply_simple_captcha
TITLE_LENGTH = Debate.columns.find{|c| c.name == 'title'}.limit
TITLE_LENGTH = Debate.columns.find { |c| c.name == 'title' }.limit
acts_as_votable
acts_as_commentable
@@ -70,7 +70,7 @@ class Debate < ActiveRecord::Base
end
def sanitize_tag_list
self.tag_list = TagSanitizer.new.sanitize_tag_list(self.tag_list)
self.tag_list = TagSanitizer.new.sanitize_tag_list(self.tag_list)
end
end

View File

@@ -15,7 +15,7 @@ class User < ActiveRecord::Base
def debate_votes(debates)
voted = votes.for_debates.in(debates)
voted.each_with_object({}) { |v,_| _[v.votable_id] = v.value }
voted.each_with_object({}) { |v, _| _[v.votable_id] = v.value }
end
def administrator?