couch_potato 1.20.0 → 1.20.1

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: 3550e8fe5b60fb064f2960a62313ee43e41e28c980c7c7d395d6c252fdb4fa20
4
- data.tar.gz: 4aff0328b8e0e2162793c8b7f81643a5a3a43b703a64b00c57f044c12aac0ab0
3
+ metadata.gz: 93355ba5d43a15b8e24563f5c31d900fc1487fd54713bff4267df3669f277e3e
4
+ data.tar.gz: b154be56a609b371d108198f3c6852a07a736e38a6b912655a846c47c4a15406
5
5
  SHA512:
6
- metadata.gz: 676096f6f62795015a3bb26b6fe27689eda09aacb59f05c1f181a2922bc968fd762a9571ef02085425071212cf3ee1c688d36caaf06ee68dafe134d6bf9c04ae
7
- data.tar.gz: 49582697b2508b97fc73a9a1a0590e6882f138577ea5ab6492746a61ab654b74170830cf9c61b4de1b36f002bd344b0b193f903dec6dc78e10f6a3f5d2c7c9d1
6
+ metadata.gz: 79da5aeef49e67beeb45a130dc4293166538929dc4391e8f6fc5c77c81014ce0e91391bf53008d5853c048bd1e611d576cfdb0283385055fae051e338edced35
7
+ data.tar.gz: efef4524ef4f1027d6d586a0b0739577bc9c21bb7de20f46022e3633911b6e0621f4413a529dbc6eb9d0e6fc7ed40d7e776ba1d4bcc639bf828c7cd2e4c75d20
data/CHANGES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Changes
2
2
 
3
+ # 1.20.1
4
+
5
+ - fix `database.save!` did not use passed block
6
+
3
7
  # 1.20.0
4
8
 
5
9
  - add passing validation context to save methods
@@ -127,8 +127,8 @@ module CouchPotato
127
127
  alias save save_document
128
128
 
129
129
  # saves a document, raises a CouchPotato::Database::ValidationsFailedError on failure
130
- def save_document!(document, options = {})
131
- save_document(document, options) || raise(ValidationsFailedError, document.errors.full_messages)
130
+ def save_document!(document, options = {}, &block)
131
+ save_document(document, options, &block) || raise(ValidationsFailedError, document.errors.full_messages)
132
132
  end
133
133
  alias save! save_document!
134
134
 
@@ -1,4 +1,4 @@
1
1
  module CouchPotato
2
- VERSION = '1.20.0'.freeze
2
+ VERSION = '1.20.1'.freeze
3
3
  RSPEC_VERSION = '4.2.0'.freeze
4
4
  end
@@ -366,6 +366,14 @@ describe CouchPotato::Database, 'save_document' do
366
366
  end
367
367
  end
368
368
 
369
+ describe CouchPotato::Database, 'save_document!' do
370
+ it 'calls the block if provided' do
371
+ doc = double('doc').as_null_object
372
+
373
+ expect {|b| CouchPotato.database.save_document!(doc, &b)}.to yield_with_args(doc)
374
+ end
375
+ end
376
+
369
377
  describe CouchPotato::Database, 'first' do
370
378
  before(:each) do
371
379
  @couchrest_db = double('couchrest db').as_null_object
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couch_potato
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.20.0
4
+ version: 1.20.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Lang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-12-09 00:00:00.000000000 Z
11
+ date: 2026-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel