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 +4 -4
- data/CHANGELOG.md +3 -1
- data/Gemfile.lock +2 -1
- data/lib/safe_polymorphic/associations.rb +2 -2
- data/lib/safe_polymorphic/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f06f554083d745cfc79de039eed142beabd97a7f2639f84c08efeb0c930e04b6
|
|
4
|
+
data.tar.gz: e9548b76fb3edd634feb10c26229e98c90e5090a9908918cda71974fd884a825
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
+
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
|
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
|
+
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
|
+
date: 2026-03-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|