diff --git a/Gemfile.lock b/Gemfile.lock index 8620fa7f0847d831c08fe2baa63874d51ddd916b..43812efc345d2c25491bc9a7c714df920702c135 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -196,6 +196,12 @@ GEM pry (>= 0.9.12) request_store (>= 1.0.5) thor (>= 0.18.1) + guard (2.6.1) + formatador (>= 0.2.4) + listen (~> 2.7) + lumberjack (~> 1.0) + pry (>= 0.9.12) + thor (>= 0.18.1) guard-cucumber (1.4.1) cucumber (>= 1.2.0) guard (>= 1.1.0) diff --git a/app/controllers/admin/admin_controller.rb b/app/controllers/admin/admin_controller.rb index 1030efd5f9dac73bf35b7447a06d2e95913029f8..8e22795ef237a77b9d8850323fef014b865b07af 100644 --- a/app/controllers/admin/admin_controller.rb +++ b/app/controllers/admin/admin_controller.rb @@ -1,7 +1,8 @@ +module Admin + class AdminController < ApplicationController -class Admin::AdminController < ApplicationController - - before_filter :authenticate_user! - before_filter :redirect_unless_admin + before_filter :authenticate_user! + before_filter :redirect_unless_admin + end end diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 678d04fb87928765aeb748f19ef602de5f3339b3..5167cdee7c7f0fd9bae64edfcd81780d6af7a364 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -1,16 +1,16 @@ +module Admin + class UsersController < AdminController -class Admin::UsersController < Admin::AdminController + def close_account + u = User.find(close_account_params) + u.close_account! + redirect_to user_search_path, notice: t('admins.user_search.account_closing_scheduled', name: u.username) + end - def close_account - u = User.find(close_account_params) - u.close_account! - redirect_to user_search_path, notice: t('admins.user_search.account_closing_scheduled', name: u.username) - end - - private + private - def close_account_params - params.require(:id) + def close_account_params + params.require(:id) + end end - end diff --git a/config/initializers/rails_admin.rb b/config/initializers/rails_admin.rb index a0b7c6ce85e2f078ec969868818b84758151e2a4..158aa991fb3a31e148ba314adc0ee1c36e502c00 100644 --- a/config/initializers/rails_admin.rb +++ b/config/initializers/rails_admin.rb @@ -40,10 +40,41 @@ if Rails.env.production? # ==> Included models # Add all excluded models here: - config.excluded_models = [AspectMembership, AspectVisibility, ShareVisibility, ConversationVisibility, NotificationActor, Notifications::AlsoCommented, Notifications::CommentOnPost, Notifications::Liked, Notifications::Mentioned, Notifications::PrivateMessage, Notifications::RequestAccepted, Notifications::Reshared, Notifications::StartedSharing, Reshare, Services::Facebook, Services::Tumblr, Services::Twitter, UserPreference, ActsAsTaggableOn::Tag] + #config.excluded_models = [] # Add models here if you want to go 'whitelist mode': - # config.included_models = [AccountDeletion, ActsAsTaggableOn::Tag, Aspect, AspectMembership, AspectVisibility, Block, Comment, Contact, Conversation, ConversationVisibility, Invitation, InvitationCode, Like, Mention, Message, Notification, NotificationActor, Notifications::AlsoCommented, Notifications::CommentOnPost, Notifications::Liked, Notifications::Mentioned, Notifications::PrivateMessage, Notifications::RequestAccepted, Notifications::Reshared, Notifications::StartedSharing, OEmbedCache, Participation, Person, Photo, Pod, Post, Profile, Reshare, Service, ServiceUser, Services::Facebook, Services::Tumblr, Services::Twitter, ShareVisibility, StatusMessage, TagFollowing, User, UserPreference] + config.included_models = %w[ + AccountDeletion + Aspect + AspectMembership + Block + Comment + Contact + Conversation + Invitation + InvitationCode + Like + Location + Mention + Message + OEmbedCache + OpenGraphCache + Person + Photo + Profile + Pod + Poll + PollAnswer + Post + Profile + Report + Reshare + Role + Service + StatusMessage + User + UserPreference + ] # Application wide tried label methods for models' instances # config.label_methods << :description # Default is [:name, :title]