action_policy 0.6.6 → 0.6.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af8c6d335ea62aa35058c7dd1bf14273df990b9dca7daa461ca8df28af10047e
4
- data.tar.gz: 1ba13e5562e5b26042a956a63e5f79f59e7590ee7da787f217a3eff1f946857b
3
+ metadata.gz: df57cf926c648dc59ed1a1afc44b352eb998f5bf03a9405127105611e641ffdb
4
+ data.tar.gz: 51a8e81c6479bf06894da3a2f8fa83c98ed25da678e73bf2462f029a75c55ec4
5
5
  SHA512:
6
- metadata.gz: e202eb13aaf0fca9d361ab3be099de48a138e7771aa8978e1e35edf87cc1ae77670b80f11f8972c292cbcf6d85c58ebc32ad426fc25357631dc5ee77ecf1efba
7
- data.tar.gz: eb4eedf9c06006fe60417eb4cf37a657826bc118cd21f97c734d9372287c81254d98369dd120edf9ddeeab3d2f4df95bf9049ae8927107c1a0b7aefcd33eb5c0
6
+ metadata.gz: 6c55e23ffeff3a1d9800512759105e509abb6b51dabee1a984c56f04daa04e661ef37e056e2fee64b86a17bff8fab8167b557d8f5fe6bd9118febf0b116f7b3a
7
+ data.tar.gz: 8c1459872bb8daa8bca216c1ee342b9c8c4b4b6fb5654301765ec4d2c7f8ff6612ab784269a89920c29f575ee9ecd79b2a470a415f92246db70c0b9d7a3631b1
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 0.6.7 (2023-09-13)
6
+
7
+ - Fix loading Rails extensions during eager load. ([@palkan][])
8
+
5
9
  ## 0.6.6 (2023-09-11)
6
10
 
7
11
  - Fix loading Active Record and Action Controller scope matchers. ([@palkan][])
@@ -61,8 +61,8 @@ module ActionPolicy # :nodoc:
61
61
  app.executor.to_complete { ActionPolicy::PerThreadCache.clear_all }
62
62
  end
63
63
 
64
- config.after_initialize do
65
- if ::Rails.application.config.action_policy.instrumentation_enabled
64
+ initializer "action_policy.extensions" do |app|
65
+ if app.config.action_policy.instrumentation_enabled
66
66
  require "action_policy/rails/policy/instrumentation"
67
67
  require "action_policy/rails/authorizer"
68
68
 
@@ -71,26 +71,26 @@ module ActionPolicy # :nodoc:
71
71
  end
72
72
 
73
73
  ActionPolicy::LookupChain.namespace_cache_enabled =
74
- ::Rails.application.config.action_policy.namespace_cache_enabled
74
+ app.config.action_policy.namespace_cache_enabled
75
75
 
76
76
  ActiveSupport.on_load(:action_controller) do
77
77
  require "action_policy/rails/scope_matchers/action_controller_params"
78
78
 
79
- next unless ::Rails.application.config.action_policy.auto_inject_into_controller
79
+ next unless app.config.action_policy.auto_inject_into_controller
80
80
 
81
81
  ActionController::Base.include ActionPolicy::Controller
82
82
 
83
- next unless ::Rails.application.config.action_policy.controller_authorize_current_user
83
+ next unless app.config.action_policy.controller_authorize_current_user
84
84
 
85
85
  ActionController::Base.authorize :user, through: :current_user
86
86
  end
87
87
 
88
88
  ActiveSupport.on_load(:action_cable) do
89
- next unless ::Rails.application.config.action_policy.auto_inject_into_channel
89
+ next unless app.config.action_policy.auto_inject_into_channel
90
90
 
91
91
  ActionCable::Channel::Base.include ActionPolicy::Channel
92
92
 
93
- next unless ::Rails.application.config.action_policy.channel_authorize_current_user
93
+ next unless app.config.action_policy.channel_authorize_current_user
94
94
 
95
95
  ActionCable::Channel::Base.authorize :user, through: :current_user
96
96
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActionPolicy
4
- VERSION = "0.6.6"
4
+ VERSION = "0.6.7"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_policy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Dementyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-12 00:00:00.000000000 Z
11
+ date: 2023-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-next-core