active_fields 2.0.0 → 2.0.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 +4 -4
- data/CHANGELOG.md +5 -0
- data/app/models/concerns/active_fields/customizable_concern.rb +0 -2
- data/app/models/concerns/active_fields/field_concern.rb +0 -2
- data/app/models/concerns/active_fields/value_concern.rb +0 -2
- data/lib/active_fields/finders/base_finder.rb +1 -1
- data/lib/active_fields/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: 6c94bb84092249c9db341f69ec79233da8440b8ef74c00475c5c8acb6e42a290
|
4
|
+
data.tar.gz: 7653a7859137a53d465ccc2398f055f064105949f0a3be7e1e7fc5f3636ee240
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57eecfc4cb3cf040dfcc2daf59a804b33ea5b3f9744cde6931c8fa0f9777eeeb067d3895b33ebbf927c5b74c66290f00546986d472d038c11df700d8092631d7
|
7
|
+
data.tar.gz: 1e923ede58bd193079334b3fcb9e193fdd61b56d6d73ffdf977a626618d2e308787641c8194ebc806113141b9dd66a3e5fbea106c0d0ded699c866a10a6b8d0b
|
data/CHANGELOG.md
CHANGED
@@ -6,14 +6,12 @@ module ActiveFields
|
|
6
6
|
extend ActiveSupport::Concern
|
7
7
|
|
8
8
|
included do
|
9
|
-
# rubocop:disable Rails/ReflectionClassName
|
10
9
|
has_many :active_values,
|
11
10
|
class_name: ActiveFields.config.value_class_name,
|
12
11
|
as: :customizable,
|
13
12
|
inverse_of: :customizable,
|
14
13
|
autosave: true,
|
15
14
|
dependent: :destroy
|
16
|
-
# rubocop:enable Rails/ReflectionClassName
|
17
15
|
|
18
16
|
# Searches customizables by active_values.
|
19
17
|
#
|
@@ -6,13 +6,11 @@ module ActiveFields
|
|
6
6
|
extend ActiveSupport::Concern
|
7
7
|
|
8
8
|
included do
|
9
|
-
# rubocop:disable Rails/ReflectionClassName
|
10
9
|
has_many :active_values,
|
11
10
|
class_name: ActiveFields.config.value_class_name,
|
12
11
|
foreign_key: :active_field_id,
|
13
12
|
inverse_of: :active_field,
|
14
13
|
dependent: :destroy
|
15
|
-
# rubocop:enable Rails/ReflectionClassName
|
16
14
|
|
17
15
|
scope :for, ->(customizable_type) { where(customizable_type: customizable_type) }
|
18
16
|
|
@@ -7,12 +7,10 @@ module ActiveFields
|
|
7
7
|
|
8
8
|
included do
|
9
9
|
belongs_to :customizable, polymorphic: true, optional: false, inverse_of: :active_values
|
10
|
-
# rubocop:disable Rails/ReflectionClassName
|
11
10
|
belongs_to :active_field,
|
12
11
|
class_name: ActiveFields.config.field_base_class_name,
|
13
12
|
optional: false,
|
14
13
|
inverse_of: :active_values
|
15
|
-
# rubocop:enable Rails/ReflectionClassName
|
16
14
|
|
17
15
|
validates :active_field, uniqueness: { scope: :customizable }
|
18
16
|
validate :validate_value
|
@@ -52,7 +52,7 @@ module ActiveFields
|
|
52
52
|
# @param op [String, Symbol] Operation name or operator
|
53
53
|
# @param value [Any] The value to search for
|
54
54
|
def search(op:, value:)
|
55
|
-
op = op.to_sym
|
55
|
+
op = op.to_sym if op.respond_to?(:to_sym)
|
56
56
|
operation = self.class.__operations__.key?(op) ? op : self.class.__operators__[op]
|
57
57
|
return if operation.nil?
|
58
58
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_fields
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kirill Usanov
|
8
8
|
- LassoID
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|