express_admin 1.7.31 → 1.7.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b7203cd11047e5af24b9b0b5e18712dc795a31b
|
4
|
+
data.tar.gz: d38502cbb43733b0148b3d6a83853fb7ffb473c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8a44e05cf7bec13d68307f375234f18cff805bc37924525e0ccfc0849ade392cca1f06f3ad291a08f9ab50f3eb3631b90d9b6ff2c71a8827674a9e17ebb6315
|
7
|
+
data.tar.gz: 3e20299dc4a5a07c4b6a2d1974404a2202cf59fe66a289844cee901ea4e0acb94a74c4cceee2d7dfa27cd19d3897f68b2972bcd06f7ec90a6db456ae8d2fe7ee
|
@@ -0,0 +1 @@
|
|
1
|
+
ExpressAdmin.initialize_current_user!
|
data/lib/express_admin.rb
CHANGED
@@ -3,6 +3,11 @@ require "express_admin/engine"
|
|
3
3
|
require "express_admin/routes"
|
4
4
|
require "express_admin/commands"
|
5
5
|
require "express_admin/commandable"
|
6
|
+
require "express_admin/current_user"
|
6
7
|
|
7
8
|
module ExpressAdmin
|
9
|
+
def self.initialize_current_user!
|
10
|
+
ActionController::Base::send(:include, ExpressAdmin::CurrentUser)
|
11
|
+
puts "Added ExpressAdmin::CurrentUser to ActionController::Base"
|
12
|
+
end
|
8
13
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'request_store'
|
2
|
+
|
3
|
+
module ExpressAdmin
|
4
|
+
module CurrentUser
|
5
|
+
def self.included(base)
|
6
|
+
base.class_eval do
|
7
|
+
include InstanceMethods
|
8
|
+
|
9
|
+
before_action do
|
10
|
+
set_current_user
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
module InstanceMethods
|
16
|
+
def set_current_user
|
17
|
+
if defined? Devise
|
18
|
+
# This allows `current_user` (if defined) to be accessible
|
19
|
+
# outside a controller.
|
20
|
+
RequestStore[:current_user] = self.try(:current_user)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: express_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.32
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Talcott Smith
|
@@ -480,8 +480,8 @@ files:
|
|
480
480
|
- app/views/shared/express_admin/_navigation_bar.html.et
|
481
481
|
- app/views/shared/express_admin/_navigation_bar_profile.html.et
|
482
482
|
- app/views/shared/express_admin/_title.html.et
|
483
|
-
- config/initializers/current_user.rb
|
484
483
|
- config/initializers/gravatar_image_tag.rb
|
484
|
+
- config/initializers/initialize_current_user.rb
|
485
485
|
- config/initializers/kaminari.rb
|
486
486
|
- config/initializers/postgresql_trigram.rb
|
487
487
|
- config/initializers/tinymce-rails.rb
|
@@ -492,6 +492,7 @@ files:
|
|
492
492
|
- lib/express_admin.rb
|
493
493
|
- lib/express_admin/commandable.rb
|
494
494
|
- lib/express_admin/commands.rb
|
495
|
+
- lib/express_admin/current_user.rb
|
495
496
|
- lib/express_admin/engine.rb
|
496
497
|
- lib/express_admin/menu.rb
|
497
498
|
- lib/express_admin/routes.rb
|