active_element 0.0.27 → 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: bd63ac61d19bd3d5a68d3b6eea3b10bdf6379374b329e41348feda051d81ed1d
4
- data.tar.gz: 5513fbf6ba143672646a23c9ebdfe63d6cf3424dced80614362e8c2f8410b2f6
3
+ metadata.gz: ecefe84af93b64fffe82107e5e7aa80781d9ee9efa3e4d04f197babc1fb7ec04
4
+ data.tar.gz: 3254a1d9613519ca0c18aceb76138632ba781cb7edee451a099f1dfb2088eb2d
5
5
  SHA512:
6
- metadata.gz: 85f92e91d4b6b40709f81fcf16f8084ee1c1561577be06faa17204112a42ff446192b5c30ddb8f87127dc767b71db99aeeb3f9dd0161ccbf35ea16542456ca7a
7
- data.tar.gz: 91cd51f08620680092588b0b647a7793813e49528a57d8097de630862930cc3f4f288318f18e389646508d20e2928652dd1a0f9983ffa61f73e1a47a6e08ea1e
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.27)
4
+ active_element (0.0.28)
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.16)
154
154
  date
155
155
  net-protocol
156
156
  net-pop (0.1.2)
@@ -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.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.27
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-08-15 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