consent 2.6.1 → 2.7.1

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: 182a86041ac92a223db915879ea70c9252e86dc3e11a34d1ed14668a9ee4578b
4
- data.tar.gz: b59b20041089b3d604bddf0b6a9ad35e03386f3a9f574a428f4057e63b4bf0fd
3
+ metadata.gz: 4de703bdf6c5d4e67c773036d77e43c78a5dcb2de51bb68365fd06e7407fd950
4
+ data.tar.gz: 41ebf6b59fe123b8fb3536664eef44049d3aafefa619abf98514e592a133279a
5
5
  SHA512:
6
- metadata.gz: b0f0eeb21f1caa422b429dad09e0d5b3636c2672cfe0114994c2707c817564f58692cdad6835d87a04c5bfd674103ac5f3775302bd5abfa778de5b741f3109bf
7
- data.tar.gz: ac2b05405d63355a47dd7e3cc18070ca3ed5254590cef2fffc192bec58b07a97830ac90903dda63182662cdbc06f29e3cc5b8f69114e75f44e966d2a389bd77f
6
+ metadata.gz: 9078167330ccab0eedb6f95f3ca981729c3a2aa3a49308ac1ba3358a09a6306a14bc0a093ba64ddbb988a3531e5951d0444527c325e430b5a801761307b29a98
7
+ data.tar.gz: fe4de64f03dbb99879a958ac3049c404b50a4e888998f092bdccc31a48611427b511b557227d4406bc1683d760e5acf1f61faae4c92c802dad22af833e9e9f26
data/Gemfile.lock CHANGED
@@ -11,7 +11,7 @@ PATH
11
11
  PATH
12
12
  remote: .
13
13
  specs:
14
- consent (2.6.1)
14
+ consent (2.7.1)
15
15
  cancancan (= 3.2.1)
16
16
 
17
17
  GEM
data/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ### [2.7.1] - 2026-08-17
4
+
5
+ - Memoize subject key resolution [#450](https://github.com/powerhome/power-tools/pull/450)
6
+
7
+ ### [2.7.0] - 2026-08-11
8
+
9
+ - Lazily load model subjects [#447](https://github.com/powerhome/power-tools/pull/447)
10
+
3
11
  ### [2.6.1] - 2026-06-26
4
12
 
5
13
  - Fixed an issue where view and action comparisons did not work unless we converted their keys to strings. [#444](https://github.com/powerhome/power-tools/pull/444)
@@ -11,7 +11,7 @@ PATH
11
11
  PATH
12
12
  remote: ..
13
13
  specs:
14
- consent (2.6.1)
14
+ consent (2.7.1)
15
15
  cancancan (= 3.2.1)
16
16
 
17
17
  GEM
@@ -11,7 +11,7 @@ PATH
11
11
  PATH
12
12
  remote: ..
13
13
  specs:
14
- consent (2.6.1)
14
+ consent (2.7.1)
15
15
  cancancan (= 3.2.1)
16
16
 
17
17
  GEM
@@ -10,10 +10,6 @@ module Consent
10
10
  config.consent = Consent::Reloader.new(default_path)
11
11
  end
12
12
 
13
- config.after_initialize do |app|
14
- app.config.consent.execute
15
- end
16
-
17
13
  initializer "consent.reloader" do |app|
18
14
  app.reloaders << config.consent
19
15
  ActiveSupport::Dependencies.autoload_paths -= config.consent.paths
@@ -2,15 +2,19 @@
2
2
 
3
3
  module Consent
4
4
  class Subject # :nodoc:
5
- attr_reader :key, :label, :actions, :views
5
+ attr_reader :label, :actions, :views
6
6
 
7
7
  def initialize(key, label)
8
- @key = key
8
+ @raw_key = key.respond_to?(:name) ? key.name : key
9
9
  @label = label
10
10
  @actions = []
11
11
  @views = Consent.default_views.clone
12
12
  end
13
13
 
14
+ def key
15
+ @key ||= Consent::SubjectCoder.load(@raw_key)
16
+ end
17
+
14
18
  def to_permission_payload
15
19
  actions = self.actions.sort
16
20
  views = self.views.values.sort
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Consent
4
- VERSION = "2.6.1"
4
+ VERSION = "2.7.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: consent
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.1
4
+ version: 2.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Palhares