active_element 0.0.26 → 0.0.28
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecefe84af93b64fffe82107e5e7aa80781d9ee9efa3e4d04f197babc1fb7ec04
|
4
|
+
data.tar.gz: 3254a1d9613519ca0c18aceb76138632ba781cb7edee451a099f1dfb2088eb2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62788c73d66270caa3cdbdc47da042f49b7386a631dcd080e9c8a8b3d05848ea4d61e95c63556190875119bc311b34ab9f7148e1c753c4551112c4ef16d288c6
|
7
|
+
data.tar.gz: 438d4fc2a31bd255522a92386b6738de859ddcd3897f668fab49aba06b3c7c63ee6fe1a57cf0ff23b7400962e3479feeaf010ecf8bb0d15302a6ce6c28b18964
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
active_element (0.0.
|
4
|
+
active_element (0.0.28)
|
5
5
|
bootstrap (~> 5.3.0alpha3)
|
6
6
|
kaminari (~> 1.2)
|
7
7
|
paintbrush (~> 0.1.2)
|
@@ -80,7 +80,7 @@ GEM
|
|
80
80
|
addressable (2.8.4)
|
81
81
|
public_suffix (>= 2.0.2, < 6.0)
|
82
82
|
ast (2.4.2)
|
83
|
-
autoprefixer-rails (10.4.
|
83
|
+
autoprefixer-rails (10.4.19.0)
|
84
84
|
execjs (~> 2)
|
85
85
|
bcrypt (3.1.18)
|
86
86
|
bootstrap (5.3.3)
|
@@ -150,7 +150,7 @@ GEM
|
|
150
150
|
mini_mime (1.1.5)
|
151
151
|
mini_portile2 (2.8.2)
|
152
152
|
minitest (5.18.1)
|
153
|
-
net-imap (0.4.
|
153
|
+
net-imap (0.4.16)
|
154
154
|
date
|
155
155
|
net-protocol
|
156
156
|
net-pop (0.1.2)
|
@@ -1,8 +1,10 @@
|
|
1
1
|
(() => {
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
document.addEventListener('DOMContentLoaded', () => {
|
3
|
+
const elements = [].slice.call(document.querySelectorAll('.toast'));
|
4
|
+
const toasts = elements.map(function (element) {
|
5
|
+
return new bootstrap.Toast(element, { animation: true, autohide: true, delay: 10000 })
|
6
|
+
});
|
7
|
+
|
8
|
+
toasts.forEach((toast) => toast.show());
|
5
9
|
});
|
6
|
-
|
7
|
-
toasts.forEach((toast) => toast.show());
|
8
10
|
})();
|
@@ -23,12 +23,10 @@ module ActiveElement
|
|
23
23
|
|
24
24
|
def relation_id # rubocop:disable Metrics/CyclomaticComplexity
|
25
25
|
case relation.macro
|
26
|
-
when :has_one
|
26
|
+
when :has_one, :belongs_to
|
27
27
|
associated_record&.public_send(relation_key)
|
28
28
|
when :has_many
|
29
29
|
associated_record&.map(&relation_key.to_sym)
|
30
|
-
when :belongs_to
|
31
|
-
record&.public_send(relation_key)
|
32
30
|
end
|
33
31
|
end
|
34
32
|
|
@@ -37,7 +35,7 @@ module ActiveElement
|
|
37
35
|
when :has_one, :has_many
|
38
36
|
relation.klass.primary_key
|
39
37
|
when :belongs_to
|
40
|
-
relation.
|
38
|
+
relation.association_primary_key
|
41
39
|
end
|
42
40
|
end
|
43
41
|
|
@@ -170,8 +170,8 @@ module ActiveElement
|
|
170
170
|
|
171
171
|
def relation_select_field(field)
|
172
172
|
association = association_mapping(field)
|
173
|
-
columns = [association.display_field, association.
|
174
|
-
[
|
173
|
+
columns = [association.display_field, association.relation_key].compact
|
174
|
+
[field, :select,
|
175
175
|
{ multiple: association_mapping(field).multiple_association?,
|
176
176
|
options: association.associated_model.pluck(*columns) }]
|
177
177
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_element
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.28
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bob Farrell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bootstrap
|