standard_procedure_fabrik 0.1.1 → 0.1.2

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
  SHA256:
3
- metadata.gz: fc634b02a078fda169f5f93bc1bd4c607b1245d3d5d866a9224ced85fb3576a1
4
- data.tar.gz: e57ba5a0e6cc50cd061fee1608e2fb096e7fab885e6389a3fd819c63530880bd
3
+ metadata.gz: 2742aab097f1a8977498b4b654829b4a6b9d54e98320a4e56a2c1419aeeb53ad
4
+ data.tar.gz: 34394ab7faa6707a2afcd4fa03d24fedc5ae84471c0f461b37ac70de5ef51ca5
5
5
  SHA512:
6
- metadata.gz: 51e2f129f76aa9a3f08b8cd53b54891d8a5d6fdefb41baa03462c8227bea30a0c9497c716a620805e242dfcfff4f54e9b95e180cb4811b9e2915c5ca3a07ef44
7
- data.tar.gz: 964e3ceab133674e4366d98b36243d5d9c9e5b0642253a4a7c43e3300150560aa8c8f218ed87eec902c9136f3ca1e169e01c451dbab9f3cc9a5e82891457a581
6
+ metadata.gz: c049dacfdaa1a044e70510216f244d3008e441f3cf950439e7862c7ed165a915e0f6b42787a3afdcca4d50be3bfd1408668308c6cab176196ffc26cad5053481
7
+ data.tar.gz: e814649e75c6cd9ea0a69d6705205b62ef91bc34b4bf545d093c616924bebe2ee84bfea09df4d0298dc294c759d44c7f4fdb7f6ee752c2a9b568e0dd7bcbdb04
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.1.2] - 2024-12-29
2
+
3
+ - Bug fix - when using defaults and search keys together
4
+
1
5
  ## [0.1.1] - 2024-12-29
2
6
 
3
7
  - Pass the database through to defaults (so you can create dependent models)
@@ -0,0 +1 @@
1
+ 939adbdd3a1922e7dc52f5125c9511bc6eb0bdc77cde5a54464b7f56506b6bf309828aac8df062d0ac8da29bcce5a0ee66affc56b20c0112df52aaa0764f736b
@@ -91,7 +91,10 @@ module Fabrik
91
91
 
92
92
  private def default_attributes = @blueprint.default_attributes
93
93
 
94
- private def find_or_create_record(attributes) = find_record(attributes) || create_record(attributes)
94
+ private def find_or_create_record(attributes)
95
+ attributes = attributes_with_defaults(attributes)
96
+ find_record(attributes) || create_record(attributes)
97
+ end
95
98
 
96
99
  private def find_record(attributes) = attributes.slice(*search_keys).empty? ? nil : klass.find_by(**attributes.slice(*search_keys))
97
100
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fabrik
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standard_procedure_fabrik
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rahoul Baruah
@@ -53,6 +53,7 @@ files:
53
53
  - Rakefile
54
54
  - checksums/standard_procedure_fabrik-0.1.0.gem.sha512
55
55
  - checksums/standard_procedure_fabrik-0.1.1.gem.sha512
56
+ - checksums/standard_procedure_fabrik-0.1.2.gem.sha512
56
57
  - lib/fabrik.rb
57
58
  - lib/fabrik/database.rb
58
59
  - lib/fabrik/version.rb