active_element 0.0.26 → 0.0.28

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b52329731b89b420606e12626f5bedadd828c0f66f24d712834fc39388c9fde
4
- data.tar.gz: b2398bf299ee37f23346edc90a68de6d374eba6e5e4fa5524a1f85b82da769c5
3
+ metadata.gz: ecefe84af93b64fffe82107e5e7aa80781d9ee9efa3e4d04f197babc1fb7ec04
4
+ data.tar.gz: 3254a1d9613519ca0c18aceb76138632ba781cb7edee451a099f1dfb2088eb2d
5
5
  SHA512:
6
- metadata.gz: 9861c843209772178a1917a61f81463d08507585bc6c6cdcd5c3e605effe83521d2caa3a249442e07a4abdc75adc36b1bdf46e5106e03d2a4bfff58263c62488
7
- data.tar.gz: 22b8dae6fbcc4095e50e74b0ec38f25ea2cd1d201549687c7f1b3af4be5de8501c773e37308967edd82d2697ca398862398d81ae892ecbeb20abf7ec8446b3fa
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.26)
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.16.0)
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.12)
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
- const elements = [].slice.call(document.querySelectorAll('.toast'));
3
- const toasts = elements.map(function (element) {
4
- return new bootstrap.Toast(element, { animation: true, autohide: true, delay: 10000 })
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.foreign_key
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.associated_model.primary_key].compact
174
- [association.relation_key, :select,
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveElement
4
- VERSION = '0.0.26'
4
+ VERSION = '0.0.28'
5
5
  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.26
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-06-06 00:00:00.000000000 Z
11
+ date: 2024-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootstrap