safe_polymorphic 0.1.4 → 0.1.5

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: 6a678b5a76f5ad4dc7a5bcd36d63c9bb5665a0680566346628a8ff6cc9a44bb5
4
- data.tar.gz: 5bfcd6dac5b7a25d4be30c87d6571c79a61d3d3b0b834feab0adc07b0b51e631
3
+ metadata.gz: f06f554083d745cfc79de039eed142beabd97a7f2639f84c08efeb0c930e04b6
4
+ data.tar.gz: e9548b76fb3edd634feb10c26229e98c90e5090a9908918cda71974fd884a825
5
5
  SHA512:
6
- metadata.gz: f53936eae5e5c8ffdc1b305d7ba8974b4eafea7f104075532079c5ca8f3fb1bda99b937819aee3bc25609ad77f751874ff18227a8e621a78afa42c762a70969a
7
- data.tar.gz: c7dc9e1abf1f92ad5ef2b57c60dfbc1e9b6924cf34be1497c23eeaed57ccdc621add2a9ae463d161b4feef2158033835b3e5e3c3d4c08fa7da84a30a699241d8
6
+ metadata.gz: e8199c95dae7dfb81f70ef30a62165eb1f1ef158bb0775f3593fc18f7dc85ae8c7d5aa281eb47250fbca27dba07463715a824c493931d9642b030889644afad6
7
+ data.tar.gz: 1c385ac6e20d6b94f7a56ab323cc38cf1b9c3aded6e6d223b80027bdd1cd3d93f46c9fa0832089a79d821c63fe1e199354ec20be5ca8c81332869428cd7a1c78
data/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
1
  ## [Unreleased]
2
2
 
3
+ - Fix compatibility with Rails `delegated_type` by accepting optional `scope` parameter in `safe_polymorphic` method signature
4
+
3
5
  ## [0.1.0] - 2022-12-28
4
6
 
5
7
  - Initial release
@@ -11,4 +13,4 @@
11
13
 
12
14
  ## [0.1.2] - 2022-12-28
13
15
 
14
- - Fix issue that forced to declare the I18n locale (`class_not_allowed`) in each project using this gem instead of using the default locale included in the gem
16
+ - Fix issue that forced to declare the I18n locale (`class_not_allowed`) in each project using this gem instead of using the default locale included in the gem
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- safe_polymorphic (0.1.4)
4
+ safe_polymorphic (0.1.5)
5
5
  activerecord (>= 7.0, < 8.3)
6
6
 
7
7
  GEM
@@ -114,6 +114,7 @@ GEM
114
114
  PLATFORMS
115
115
  arm64-darwin-21
116
116
  arm64-darwin-23
117
+ arm64-darwin-24
117
118
  x86_64-linux
118
119
 
119
120
  DEPENDENCIES
@@ -11,8 +11,8 @@ module SafePolymorphic
11
11
  end
12
12
 
13
13
  module ClassMethods
14
- def safe_polymorphic(name, **options)
15
- unsafe_polymorphic name, **options
14
+ def safe_polymorphic(name, scope = nil, **options)
15
+ unsafe_polymorphic name, scope, **options
16
16
  polymorphic = options[:polymorphic]
17
17
 
18
18
  return unless polymorphic.present? && polymorphic.class != TrueClass
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SafePolymorphic
4
- VERSION = '0.1.4'
4
+ VERSION = '0.1.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: safe_polymorphic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Erlichman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-03-11 00:00:00.000000000 Z
11
+ date: 2026-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord