mince 0.0.8 → 0.0.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.
@@ -19,6 +19,10 @@ module Mince
19
19
  collection(collection_name).update({}, {"$unset" => { key => 1 } }, multi: true)
20
20
  end
21
21
 
22
+ def delete_by_params(collection_name, params)
23
+ collection(collection_name).remove(params)
24
+ end
25
+
22
26
  def add(collection_name, hash)
23
27
  collection(collection_name).insert(hash)
24
28
  end
data/lib/mince/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mince
2
- VERSION = '0.0.8'
2
+ VERSION = '0.0.9'
3
3
  end
@@ -33,6 +33,13 @@ describe Mince::DataStore do
33
33
  subject.delete_field(collection_name, field)
34
34
  end
35
35
 
36
+ it 'can delete all records the match a given set of params' do
37
+ params = mock 'params to condition the deleted records to'
38
+ collection.should_receive(:remove).with(params)
39
+
40
+ subject.delete_by_params(collection_name, params)
41
+ end
42
+
36
43
  describe "Generating a primary key" do
37
44
  let(:unique_id) { mock 'id' }
38
45
  it 'should create a reasonably unique id' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mince
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: