makes spaces consistent
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
class AccountController < ApplicationController
|
||||
|
||||
before_action :authenticate_user!
|
||||
before_action :set_account
|
||||
load_and_authorize_resource class: "User"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::CommentsController < Admin::BaseController
|
||||
|
||||
has_filters %w{all with_confirmed_hide}
|
||||
|
||||
before_filter :load_comment, only: [:confirm_hide, :restore]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::ModeratorsController < Admin::BaseController
|
||||
|
||||
load_and_authorize_resource
|
||||
|
||||
def index
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::OrganizationsController < Admin::BaseController
|
||||
|
||||
has_filters %w{all pending verified rejected}, only: :index
|
||||
|
||||
load_and_authorize_resource except: :search
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::UsersController < Admin::BaseController
|
||||
|
||||
has_filters %w{all with_confirmed_hide}, only: :index
|
||||
|
||||
before_filter :load_user, only: [:confirm_hide, :restore]
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class Api::StatsController < Api::ApiController
|
||||
|
||||
def show
|
||||
unless params[:events].present? || params[:visits].present?
|
||||
return render json: {}, status: :bad_request
|
||||
@@ -19,4 +20,5 @@ class Api::StatsController < Api::ApiController
|
||||
|
||||
render json: ds.build
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -2,9 +2,9 @@ class Moderation::BaseController < ApplicationController
|
||||
layout 'admin'
|
||||
|
||||
before_action :authenticate_user!
|
||||
before_action :verify_moderator
|
||||
|
||||
skip_authorization_check
|
||||
before_action :verify_moderator
|
||||
|
||||
private
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Moderation::CommentsController < Moderation::BaseController
|
||||
|
||||
has_filters %w{all pending_flag_review with_ignored_flag}, only: :index
|
||||
|
||||
before_filter :load_comments, only: :index
|
||||
|
||||
load_and_authorize_resource
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Moderation::DebatesController < Moderation::BaseController
|
||||
|
||||
has_filters %w{all pending_flag_review with_ignored_flag}, only: :index
|
||||
|
||||
before_filter :load_debates, only: :index
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class Organizations::RegistrationsController < Devise::RegistrationsController
|
||||
|
||||
def new
|
||||
super do |user|
|
||||
user.build_organization
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class PagesController < ApplicationController
|
||||
|
||||
skip_authorization_check
|
||||
|
||||
def census_terms
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class StatsController < ApplicationController
|
||||
skip_authorization_check
|
||||
before_action :verify_administrator
|
||||
skip_authorization_check
|
||||
|
||||
def show
|
||||
@event_types = Ahoy::Event.select(:name).uniq.pluck(:name)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
||||
|
||||
def self.provides_callback_for(provider)
|
||||
class_eval %Q{
|
||||
def #{provider}
|
||||
@@ -26,4 +27,5 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
||||
finish_signup_path
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
module ApplicationHelper
|
||||
|
||||
def percentage(vote, debate)
|
||||
return "0%" if debate.total_votes == 0
|
||||
debate.send(vote).percent_of(debate.total_votes).to_s + "%"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
module CacheKeysHelper
|
||||
|
||||
def locale_and_user_status
|
||||
@cache_key_user ||= calculate_user_status
|
||||
"#{I18n.locale}/#{@cache_key_user}"
|
||||
@@ -17,4 +18,5 @@ module CacheKeysHelper
|
||||
|
||||
user_status
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,4 +1,5 @@
|
||||
module FlagsHelper
|
||||
|
||||
def show_flag_action?(flaggable)
|
||||
current_user && !own_flaggable?(flaggable) && !flagged?(flaggable)
|
||||
end
|
||||
@@ -24,4 +25,5 @@ module FlagsHelper
|
||||
flaggable.author_id == current_user.id
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
module StatsHelper
|
||||
|
||||
def events_chart_tag(events, opt={})
|
||||
events = events.join(',') if events.is_a? Array
|
||||
opt[:data] ||= {}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Flag < ActiveRecord::Base
|
||||
|
||||
belongs_to :user
|
||||
belongs_to :flaggable, polymorphic: true, counter_cache: true
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Organization < ActiveRecord::Base
|
||||
|
||||
belongs_to :user
|
||||
|
||||
validates :name, presence: true
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
class Setting < ActiveRecord::Base
|
||||
|
||||
validates :key, presence: true, uniqueness: true
|
||||
|
||||
default_scope { order(key: :desc) }
|
||||
|
||||
Reference in New Issue
Block a user