active_element 0.0.27 → 0.0.29
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cb0aa53f1b0832280482cb35d23d5bbcc7ece8f7b03001f81e9d18d290cc831
|
4
|
+
data.tar.gz: c1a34228e6c2529294ab30a4e9232d2ce6bef50f396951224b5740d67d992cf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d64eb7cc1f58b62c0e15d8b8e47029ea41073afbd058a2ce35bcee0d9e41de90ffcf32551d5d0c5a3bd2bea39d4ec7578ef99854a2530d96707b9f9bbd79e8d8
|
7
|
+
data.tar.gz: bd7207c7873eda19bcba2e458e78753a95a653371f07576df7b47da2a280ad3c83fb14d85f78a1193b3ce9ba0c0cb26586a0e6ef553a2013343aa6618dc8f69f
|
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.29)
|
5
5
|
bootstrap (~> 5.3.0alpha3)
|
6
6
|
kaminari (~> 1.2)
|
7
7
|
paintbrush (~> 0.1.2)
|
@@ -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.17)
|
154
154
|
date
|
155
155
|
net-protocol
|
156
156
|
net-pop (0.1.2)
|
@@ -76,7 +76,7 @@
|
|
76
76
|
<meta name="active_element_controller_path" content="<%= controller_path %>">
|
77
77
|
|
78
78
|
<%= stylesheet_link_tag 'active_element/active_element' %>
|
79
|
-
<%= javascript_include_tag 'active_element/active_element' %>
|
79
|
+
<%= javascript_include_tag 'active_element/active_element', 'data-turbo-track': 'reload', 'data-turbolinks-track': 'reload' %>
|
80
80
|
|
81
81
|
<% if Rails.application.assets&.find_asset('application.css').present? %>
|
82
82
|
<%= stylesheet_link_tag 'application' %>
|
@@ -122,7 +122,6 @@
|
|
122
122
|
<%= render_active_element_hook 'active_element/after_content' %>
|
123
123
|
|
124
124
|
<% if !respond_to?(:javascript_importmap_tags) && Rails.application.assets&.find_asset('application.js').present? %>
|
125
|
-
<%= javascript_include_tag 'active_element/active_element', 'data-turbo-track': 'reload', 'data-turbolinks-track': 'reload' %>
|
126
125
|
<%= javascript_include_tag 'application', 'data-turbo-track': 'reload', 'data-turbolinks-track': 'reload' %>
|
127
126
|
<% end %>
|
128
127
|
</body>
|
@@ -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.29
|
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-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bootstrap
|