rails-image-post-solution 0.1.14 → 0.1.16
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 +4 -4
- data/app/controllers/rails_image_post_solution/admin/frozen_posts_controller.rb +0 -6
- data/app/controllers/rails_image_post_solution/admin/image_reports_controller.rb +0 -15
- data/app/controllers/rails_image_post_solution/admin/users_controller.rb +0 -6
- data/app/controllers/rails_image_post_solution/image_reports_controller.rb +0 -12
- data/lib/rails_image_post_solution/engine.rb +4 -4
- data/lib/rails_image_post_solution/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3dc383f418541060b7657b51b5002623c4981ee2cf71be3ba66d9c6db4e1dc78
|
|
4
|
+
data.tar.gz: c7056f9b6827f4a37f5c0373d12ee7b80a5b160451fad858dd1ff4b77a989a39
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f88a981f2020de018b9044df232dfffc53e70c20a9a32d158d176bb50134649e8816a5429f869a38bfdd2986b8eccba9ddde9b2a55585a0f375020937e60ec6b
|
|
7
|
+
data.tar.gz: a3f25dd74a10298493af80c43c7aa85d616e02bb27e56c3d3b99514c24e4c317fbc128aba7c5e6bb90aade0c4346ce5c0507c7a5cc49a30e8d9d08de0c22b8b0
|
|
@@ -72,21 +72,6 @@ module RailsImagePostSolution
|
|
|
72
72
|
rescue ActiveRecord::RecordNotFound
|
|
73
73
|
redirect_to admin_image_reports_path, alert: I18n.t("rails_image_post_solution.flash.admin.report_not_found")
|
|
74
74
|
end
|
|
75
|
-
|
|
76
|
-
def require_admin
|
|
77
|
-
admin_check = RailsImagePostSolution.configuration&.admin_check_method || :admin?
|
|
78
|
-
|
|
79
|
-
return if current_user.respond_to?(admin_check) && current_user.public_send(admin_check)
|
|
80
|
-
|
|
81
|
-
redirect_to main_app.root_path, alert: I18n.t("rails_image_post_solution.flash.admin.admin_access_only")
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
def require_login
|
|
85
|
-
# Call authentication method implemented in host application
|
|
86
|
-
return if respond_to?(:current_user) && current_user
|
|
87
|
-
|
|
88
|
-
redirect_to main_app.root_path, alert: I18n.t("rails_image_post_solution.flash.admin.login_required")
|
|
89
|
-
end
|
|
90
75
|
end
|
|
91
76
|
end
|
|
92
77
|
end
|
|
@@ -91,12 +91,6 @@ module RailsImagePostSolution
|
|
|
91
91
|
rescue ActiveRecord::RecordNotFound
|
|
92
92
|
redirect_to admin_users_path, alert: I18n.t("admin.flash.user_not_found")
|
|
93
93
|
end
|
|
94
|
-
|
|
95
|
-
def require_admin
|
|
96
|
-
return if current_user.admin?
|
|
97
|
-
|
|
98
|
-
redirect_to root_path, alert: I18n.t("admin.flash.admin_access_only")
|
|
99
|
-
end
|
|
100
94
|
end
|
|
101
95
|
end
|
|
102
96
|
end
|
|
@@ -71,17 +71,5 @@ module RailsImagePostSolution
|
|
|
71
71
|
end
|
|
72
72
|
end
|
|
73
73
|
end
|
|
74
|
-
|
|
75
|
-
def require_login
|
|
76
|
-
# Call authentication method implemented in host application
|
|
77
|
-
return if respond_to?(:current_user) && current_user
|
|
78
|
-
|
|
79
|
-
respond_to do |format|
|
|
80
|
-
format.json do
|
|
81
|
-
render json: { error: I18n.t("rails_image_post_solution.flash.login_required") }, status: :unauthorized
|
|
82
|
-
end
|
|
83
|
-
format.html { redirect_to main_app.root_path, alert: I18n.t("rails_image_post_solution.flash.login_required") }
|
|
84
|
-
end
|
|
85
|
-
end
|
|
86
74
|
end
|
|
87
75
|
end
|
|
@@ -7,7 +7,7 @@ module RailsImagePostSolution
|
|
|
7
7
|
isolate_namespace RailsImagePostSolution
|
|
8
8
|
|
|
9
9
|
# Explicitly set engine root
|
|
10
|
-
config.root = File.expand_path(
|
|
10
|
+
config.root = File.expand_path("../..", __dir__)
|
|
11
11
|
|
|
12
12
|
# Eager load engine classes to ensure they're available
|
|
13
13
|
config.eager_load_paths += %W[
|
|
@@ -18,16 +18,16 @@ module RailsImagePostSolution
|
|
|
18
18
|
config.to_prepare do
|
|
19
19
|
# Ensure Admin module is loaded
|
|
20
20
|
unless defined?(RailsImagePostSolution::Admin)
|
|
21
|
-
require Engine.root.join(
|
|
21
|
+
require Engine.root.join("app/controllers/rails_image_post_solution/admin.rb")
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
# Ensure ApplicationController is loaded
|
|
25
25
|
unless defined?(RailsImagePostSolution::ApplicationController)
|
|
26
|
-
require Engine.root.join(
|
|
26
|
+
require Engine.root.join("app/controllers/rails_image_post_solution/application_controller.rb")
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
# Eager load all admin controllers
|
|
30
|
-
Dir[Engine.root.join(
|
|
30
|
+
Dir[Engine.root.join("app/controllers/rails_image_post_solution/admin/**/*_controller.rb")].each do |file|
|
|
31
31
|
require file
|
|
32
32
|
end
|
|
33
33
|
end
|