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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b486c6d4726a0d3774bf530d8fc27e2e5ee22a869535ae635b448991a896c46a
4
- data.tar.gz: 9a6b640e3f4eb3ca43d9fd202284b0d095d1bd7c1d3be4d57b319f69489a173c
3
+ metadata.gz: 3dc383f418541060b7657b51b5002623c4981ee2cf71be3ba66d9c6db4e1dc78
4
+ data.tar.gz: c7056f9b6827f4a37f5c0373d12ee7b80a5b160451fad858dd1ff4b77a989a39
5
5
  SHA512:
6
- metadata.gz: 318733add4a1dfc760608aefc72f5ff7e54888a832dcaa9bf15c9d4a8437d426ccde18ef4c9ffa5e2d8158d1131e849a89b927794ed16e758b70ba9401d1ad6f
7
- data.tar.gz: 872cec66f1cf53510f13e6de9ac3075997a875a3c1ce1669daa24c2f04b587ec548e9170f11db2c173ae4a98ff74d53997355092fb0f8dc4ba04d23c639003f5
6
+ metadata.gz: f88a981f2020de018b9044df232dfffc53e70c20a9a32d158d176bb50134649e8816a5429f869a38bfdd2986b8eccba9ddde9b2a55585a0f375020937e60ec6b
7
+ data.tar.gz: a3f25dd74a10298493af80c43c7aa85d616e02bb27e56c3d3b99514c24e4c317fbc128aba7c5e6bb90aade0c4346ce5c0507c7a5cc49a30e8d9d08de0c22b8b0
@@ -70,12 +70,6 @@ module RailsImagePostSolution
70
70
  end
71
71
 
72
72
  private
73
-
74
- def require_admin
75
- return if current_user.admin?
76
-
77
- redirect_to root_path, alert: I18n.t("admin.flash.access_denied")
78
- end
79
73
  end
80
74
  end
81
75
  end
@@ -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('../..', __dir__)
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('app/controllers/rails_image_post_solution/admin.rb')
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('app/controllers/rails_image_post_solution/application_controller.rb')
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('app/controllers/rails_image_post_solution/admin/**/*_controller.rb')].each do |file|
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsImagePostSolution
4
- VERSION = "0.1.14"
4
+ VERSION = "0.1.16"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-image-post-solution
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.14
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - dhq_boiler