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: bd63ac61d19bd3d5a68d3b6eea3b10bdf6379374b329e41348feda051d81ed1d
4
- data.tar.gz: 5513fbf6ba143672646a23c9ebdfe63d6cf3424dced80614362e8c2f8410b2f6
3
+ metadata.gz: 1cb0aa53f1b0832280482cb35d23d5bbcc7ece8f7b03001f81e9d18d290cc831
4
+ data.tar.gz: c1a34228e6c2529294ab30a4e9232d2ce6bef50f396951224b5740d67d992cf8
5
5
  SHA512:
6
- metadata.gz: 85f92e91d4b6b40709f81fcf16f8084ee1c1561577be06faa17204112a42ff446192b5c30ddb8f87127dc767b71db99aeeb3f9dd0161ccbf35ea16542456ca7a
7
- data.tar.gz: 91cd51f08620680092588b0b647a7793813e49528a57d8097de630862930cc3f4f288318f18e389646508d20e2928652dd1a0f9983ffa61f73e1a47a6e08ea1e
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.27)
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.14)
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.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.27'
4
+ VERSION = '0.0.29'
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.27
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-08-15 00:00:00.000000000 Z
11
+ date: 2024-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootstrap