delete_recursively 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/delete_recursively.rb +4 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 921148e05a27eafd269dc34c13d9ea5a1b5ad20a
4
- data.tar.gz: fa5b07ff8d7593e2b394e813496e3b877e1459f6
3
+ metadata.gz: 87a42e8c61f945033a7d70c5be9b5d08e1002f47
4
+ data.tar.gz: 72ce8ee5ddbd3812f4613508f2025e843b1b37ca
5
5
  SHA512:
6
- metadata.gz: 5eaf26c72502dd5dd3360f1c26329bf5489a53bd95c46a1e670d29309583934c65b17f35b29fe150404a8bc09a3e70b386880e8aa0e6448f91831602b85c9f09
7
- data.tar.gz: 13bacbff5ab53684be0ebe6ba2023c0619a27808c40816f5390f2eabd6d21a7a3b4248e6b5984fa944700d75bee55e0cee555fa833c7c8504982ff373f68f147
6
+ metadata.gz: 9834aae07555564f02a5e4b3f971404f56503652185c3f5c1e33a5931ca3622c973ad20d0291232fe4d58794dd5a19e8526ad035121ad2a92e9fb03c653472a2
7
+ data.tar.gz: 9fa49fa62dbabe053bcb983840f7b2f514adaf53aa33145f8459f0c155583150a49ad8a8b6605245b16e31e51cf9a92abe5d66f87b3cddf91ea9da118dac97cf
@@ -63,7 +63,10 @@ module DeleteRecursively
63
63
  end
64
64
 
65
65
  def self.all(record_class, criteria = {})
66
- record_class.delete_all(criteria)
66
+ applicable_criteria = criteria.select do |column_name, _value|
67
+ record_class.column_names.include?(column_name.to_s)
68
+ end
69
+ record_class.delete_all(applicable_criteria)
67
70
  record_class.reflect_on_all_associations.each do |reflection|
68
71
  all(reflection.klass, criteria) if recurse_on?(reflection)
69
72
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delete_recursively
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janosch Müller