activerecord-bixformer 0.4.8 → 0.4.9

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
  SHA1:
3
- metadata.gz: 61e297f355726471a47c004fa3c919a267e3643b
4
- data.tar.gz: b109cccd018b3f4f7244aad681563c9fa46f5e0f
3
+ metadata.gz: 2997fd363bb3144808f6fc79f37a77e010c545b1
4
+ data.tar.gz: 00d3291893753e6115c797e87b9c3be4766f6678
5
5
  SHA512:
6
- metadata.gz: ba619a3e96136506403b5c4bbf2a7653cb0796dfc95e1976e5b041fde05c43063eaeef466bce2d2a2b32800ff052bc7d41ee85941ca51a58705dc6a0f011ba89
7
- data.tar.gz: 2ab27589fd2dace89b848cbe6703060782560b02eefce767a3cf84c5ac763c94e1c29efc6dc59f0cd32ab354dae75accd025bcbec846e0c48291cd4384586afe
6
+ metadata.gz: 25b2c4383f76c590735b67f700d34985954823657360034d0c888d6eb576343533f7e4c1d8e667b42b0adae40d71d9c01c2608aebb96164ef9d3c17463b5b0de
7
+ data.tar.gz: 8f8fb5c76740f603cbac2a1a32b6cb22e895079ee62afe69fe9f3d03538b119681d6e197fe084229cf3519181beb7a837024989fe7a34524d3064376c22f4e5a
@@ -146,6 +146,8 @@ module ActiveRecord
146
146
  normalizer.normalize(values).tap do |normalized_values|
147
147
  # 結果ハッシュに何かキーがある場合だけ
148
148
  if normalized_values.present?
149
+ association_names = @associations.map(&:name)
150
+
149
151
  # デフォルト値の補完
150
152
  @default_values.each do |attribute_name, default_value|
151
153
  # 有効な値が既に格納されている場合は補完しない
@@ -154,6 +156,9 @@ module ActiveRecord
154
156
  # preferred_skip_attributes で指定されてる場合は補完しない
155
157
  next if @preferred_skip_attributes.include?(attribute_name)
156
158
 
159
+ # default_values には association も含まれているため、チェック
160
+ next if association_names.include?(attribute_name)
161
+
157
162
  normalized_values[attribute_name] = if default_value.is_a?(::Proc)
158
163
  default_value.call
159
164
  else
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module Bixformer
3
- VERSION = "0.4.8"
3
+ VERSION = "0.4.9"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-bixformer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.8
4
+ version: 0.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroaki Otsu