Merge pull request #432 from differentreality/style_module

enable style ClassAndModuleChildren
This commit is contained in:
Artem Chernikov 2014-08-11 10:26:23 +02:00
commit ac25561523
23 changed files with 615 additions and 566 deletions

View file

@ -8,7 +8,7 @@
# Offense count: 20 # Offense count: 20
# Configuration parameters: EnforcedStyle, SupportedStyles. # Configuration parameters: EnforcedStyle, SupportedStyles.
Style/ClassAndModuleChildren: Style/ClassAndModuleChildren:
Enabled: false Enabled: true
# Offense count: 3 # Offense count: 3
# Cop supports --auto-correct. # Cop supports --auto-correct.

View file

@ -1,4 +1,5 @@
class Admin::CallforpapersController < ApplicationController module Admin
class CallforpapersController < ApplicationController
before_filter :verify_organizer before_filter :verify_organizer
def show def show
@ -49,4 +50,5 @@ class Admin::CallforpapersController < ApplicationController
alert: "Creating the call for papers failed. #{@cfp.errors.to_a.join(". ")}.") alert: "Creating the call for papers failed. #{@cfp.errors.to_a.join(". ")}.")
end end
end end
end
end end

View file

@ -1,4 +1,5 @@
class Admin::CommercialsController < ApplicationController module Admin
class CommercialsController < ApplicationController
before_action :set_conference before_action :set_conference
before_action :set_commercial, only: [:edit, :update, :destroy] before_action :set_commercial, only: [:edit, :update, :destroy]
@ -54,4 +55,5 @@ class Admin::CommercialsController < ApplicationController
#params.require(:commercial).permit(:commercial_id, :commercial_type) #params.require(:commercial).permit(:commercial_id, :commercial_type)
params[:commercial] params[:commercial]
end end
end
end end

View file

@ -1,4 +1,5 @@
class Admin::ConferenceController < ApplicationController module Admin
class ConferenceController < ApplicationController
before_filter :verify_organizer before_filter :verify_organizer
def index def index
@ -172,4 +173,5 @@ class Admin::ConferenceController < ApplicationController
format.json { render json: @conference.to_json } format.json { render json: @conference.to_json }
end end
end end
end
end end

View file

@ -1,4 +1,5 @@
class Admin::ContactsController < ApplicationController module Admin
class ContactsController < ApplicationController
before_action :set_conference before_action :set_conference
before_action :set_contact, only: [:show, :edit, :update, :destroy] before_action :set_contact, only: [:show, :edit, :update, :destroy]
@ -41,4 +42,5 @@ class Admin::ContactsController < ApplicationController
# params.require(:contact).permit(:social_tag, :email, :facebook, :googleplus, :twitter, :instagram, :public) # params.require(:contact).permit(:social_tag, :email, :facebook, :googleplus, :twitter, :instagram, :public)
params[:contact] params[:contact]
end end
end
end end

View file

@ -1,4 +1,5 @@
class Admin::DietchoicesController < ApplicationController module Admin
class DietchoicesController < ApplicationController
before_filter :verify_organizer before_filter :verify_organizer
def show def show
@ -13,4 +14,5 @@ class Admin::DietchoicesController < ApplicationController
redirect_to(admin_conference_dietary_list_path(conference_id: @conference.short_title), alert: "Dietary choices update failed: #{e.message}") redirect_to(admin_conference_dietary_list_path(conference_id: @conference.short_title), alert: "Dietary choices update failed: #{e.message}")
end end
end end
end
end end

View file

@ -1,4 +1,5 @@
class Admin::DifficultyLevelsController < ApplicationController module Admin
class DifficultyLevelsController < ApplicationController
before_filter :verify_organizer before_filter :verify_organizer
def index def index
@ -26,4 +27,5 @@ class Admin::DifficultyLevelsController < ApplicationController
redirect_to(admin_conference_difficulty_levels_path(conference_id: @conference.short_title)) redirect_to(admin_conference_difficulty_levels_path(conference_id: @conference.short_title))
end end
end end
end
end end

View file

@ -1,4 +1,5 @@
class Admin::EmailsController < ApplicationController module Admin
class EmailsController < ApplicationController
before_filter :verify_organizer before_filter :verify_organizer
def update def update
@ -11,4 +12,5 @@ class Admin::EmailsController < ApplicationController
def index def index
@settings = @conference.email_settings @settings = @conference.email_settings
end end
end
end end

View file

@ -1,4 +1,5 @@
class Admin::EventtypesController < ApplicationController module Admin
class EventtypesController < ApplicationController
before_filter :verify_organizer before_filter :verify_organizer
def show def show
@ -15,4 +16,5 @@ class Admin::EventtypesController < ApplicationController
conference_id: @conference.short_title), conference_id: @conference.short_title),
alert: "Event types update failed: #{e.message}") alert: "Event types update failed: #{e.message}")
end end
end
end end

View file

@ -1,4 +1,5 @@
class Admin::QuestionsController < ApplicationController module Admin
class QuestionsController < ApplicationController
before_filter :verify_organizer before_filter :verify_organizer
def index def index
@ -40,7 +41,6 @@ class Admin::QuestionsController < ApplicationController
# PUT questions/1 # PUT questions/1
def update def update
@conference = Conference.find_by(short_title: params[:conference_id]) @conference = Conference.find_by(short_title: params[:conference_id])
@question = Question.find(params[:id]) @question = Question.find(params[:id])
@ -93,4 +93,5 @@ class Admin::QuestionsController < ApplicationController
@questions = Question.where(global: true).all | Question.where(conference_id: @conference.id) @questions = Question.where(global: true).all | Question.where(conference_id: @conference.id)
@questions_conference = @conference.questions @questions_conference = @conference.questions
end end
end
end end

View file

@ -1,4 +1,5 @@
class Admin::RoomsController < ApplicationController module Admin
class RoomsController < ApplicationController
before_filter :verify_organizer before_filter :verify_organizer
def show def show
@ -16,4 +17,5 @@ class Admin::RoomsController < ApplicationController
notice: 'Room update failed.') notice: 'Room update failed.')
end end
end end
end
end end

View file

@ -1,4 +1,5 @@
class Admin::SocialEventsController < ApplicationController module Admin
class SocialEventsController < ApplicationController
before_filter :verify_organizer before_filter :verify_organizer
def show def show
@ -12,4 +13,5 @@ class Admin::SocialEventsController < ApplicationController
redirect_to(admin_conference_social_events_path(conference_id: @conference.short_title), notice: 'Social events update failed.') redirect_to(admin_conference_social_events_path(conference_id: @conference.short_title), notice: 'Social events update failed.')
end end
end end
end
end end

View file

@ -1,4 +1,5 @@
class Admin::SupporterLevelsController < ApplicationController module Admin
class SupporterLevelsController < ApplicationController
before_filter :verify_organizer before_filter :verify_organizer
def show def show
@ -13,4 +14,5 @@ class Admin::SupporterLevelsController < ApplicationController
redirect_to(admin_conference_supporter_levels_path(conference_id: @conference.short_title), alert: "Supporter levels update failed: #{e.message}") redirect_to(admin_conference_supporter_levels_path(conference_id: @conference.short_title), alert: "Supporter levels update failed: #{e.message}")
end end
end end
end
end end

View file

@ -1,4 +1,5 @@
class Admin::SupportersController < ApplicationController module Admin
class SupportersController < ApplicationController
before_filter :verify_organizer before_filter :verify_organizer
def index def index
@ -13,4 +14,5 @@ class Admin::SupportersController < ApplicationController
SupporterRegistration.create!(params[:supporter_registration]) SupporterRegistration.create!(params[:supporter_registration])
redirect_to(admin_conference_supporters_path(conference_id: @conference.short_title), notice: "Supporter added") redirect_to(admin_conference_supporters_path(conference_id: @conference.short_title), notice: "Supporter added")
end end
end
end end

View file

@ -1,4 +1,5 @@
class Admin::TracksController < ApplicationController module Admin
class TracksController < ApplicationController
before_filter :verify_organizer before_filter :verify_organizer
def show def show
@ -19,4 +20,5 @@ class Admin::TracksController < ApplicationController
notice: 'Tracks update failed.') notice: 'Tracks update failed.')
end end
end end
end
end end

View file

@ -1,4 +1,5 @@
class Admin::VenueController < ApplicationController module Admin
class VenueController < ApplicationController
before_filter :verify_organizer before_filter :verify_organizer
def index def index
@ -27,4 +28,5 @@ class Admin::VenueController < ApplicationController
@venue = @conference.venue @venue = @conference.venue
render :venue_info render :venue_info
end end
end
end end

View file

@ -1,4 +1,5 @@
class Admin::VolunteersController < ApplicationController module Admin
class VolunteersController < ApplicationController
def index def index
@conference = Conference.find_by(short_title: params[:conference_id]) @conference = Conference.find_by(short_title: params[:conference_id])
render :index render :index
@ -22,4 +23,5 @@ class Admin::VolunteersController < ApplicationController
redirect_to(admin_conference_volunteers_info_path(conference_id: params[:conference_id]), alert: "Volunteering options update failed: #{e.message}") redirect_to(admin_conference_volunteers_info_path(conference_id: params[:conference_id]), alert: "Volunteering options update failed: #{e.message}")
end end
end end
end
end end

View file

@ -1,3 +1,5 @@
class Api::BaseController < ActionController::Base module Api
class BaseController < ActionController::Base
protect_from_forgery protect_from_forgery
end
end end

View file

@ -1,4 +1,6 @@
class Api::V1::ConferencesController < Api::BaseController module Api
module V1
class ConferencesController < Api::BaseController
respond_to :json respond_to :json
def index def index
@ -9,4 +11,6 @@ class Api::V1::ConferencesController < Api::BaseController
end end
render json: conferences, serializer: ConferencesArraySerializer render json: conferences, serializer: ConferencesArraySerializer
end end
end
end
end end

View file

@ -1,4 +1,6 @@
class Api::V1::RoomsController < Api::BaseController module Api
module V1
class RoomsController < Api::BaseController
respond_to :json respond_to :json
def index def index
@ -10,4 +12,6 @@ class Api::V1::RoomsController < Api::BaseController
end end
respond_with rooms respond_with rooms
end end
end
end
end end

View file

@ -1,4 +1,6 @@
class Api::V1::TracksController < Api::BaseController module Api
module V1
class TracksController < Api::BaseController
respond_to :json respond_to :json
def index def index
@ -10,4 +12,6 @@ class Api::V1::TracksController < Api::BaseController
end end
respond_with tracks respond_with tracks
end end
end
end
end end

View file

@ -1,3 +1,5 @@
class Ahoy::Store < Ahoy::Stores::ActiveRecordStore module Ahoy
class Store < Ahoy::Stores::ActiveRecordStore
# customize here # customize here
end
end end

View file

@ -1,10 +1,12 @@
class ActiveRecord::Base module ActiveRecord
class Base
mattr_accessor :shared_connection mattr_accessor :shared_connection
@@shared_connection = nil @@shared_connection = nil
def self.connection def self.connection
@@shared_connection || retrieve_connection @@shared_connection || retrieve_connection
end end
end
end end
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection