Fix loading issues in rails_admin
Properly declare Admin module and explicitly list models to be display in rails_admin
This commit is contained in:
parent
00de34ba38
commit
541d5580e0
4 changed files with 56 additions and 18 deletions
|
|
@ -196,6 +196,12 @@ GEM
|
||||||
pry (>= 0.9.12)
|
pry (>= 0.9.12)
|
||||||
request_store (>= 1.0.5)
|
request_store (>= 1.0.5)
|
||||||
thor (>= 0.18.1)
|
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)
|
guard-cucumber (1.4.1)
|
||||||
cucumber (>= 1.2.0)
|
cucumber (>= 1.2.0)
|
||||||
guard (>= 1.1.0)
|
guard (>= 1.1.0)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
|
module Admin
|
||||||
class Admin::AdminController < ApplicationController
|
class AdminController < ApplicationController
|
||||||
|
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
before_filter :redirect_unless_admin
|
before_filter :redirect_unless_admin
|
||||||
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
|
module Admin
|
||||||
class Admin::UsersController < Admin::AdminController
|
class UsersController < AdminController
|
||||||
|
|
||||||
def close_account
|
def close_account
|
||||||
u = User.find(close_account_params)
|
u = User.find(close_account_params)
|
||||||
|
|
@ -12,5 +12,5 @@ class Admin::UsersController < Admin::AdminController
|
||||||
def close_account_params
|
def close_account_params
|
||||||
params.require(:id)
|
params.require(:id)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -40,10 +40,41 @@ if Rails.env.production?
|
||||||
|
|
||||||
# ==> Included models
|
# ==> Included models
|
||||||
# Add all excluded models here:
|
# 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':
|
# 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
|
# Application wide tried label methods for models' instances
|
||||||
# config.label_methods << :description # Default is [:name, :title]
|
# config.label_methods << :description # Default is [:name, :title]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue