ar_left_over_guardian 0.0.1 → 0.0.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
  SHA1:
3
- metadata.gz: b56afe1b169a361ea5471b5e4778c769a4317c3e
4
- data.tar.gz: 102d2623d61281142d585e05e5405ed7e2d0020b
3
+ metadata.gz: b9a2568d707a54c60cb4e0de80274111fdc1475f
4
+ data.tar.gz: 062cb2df042522fcb8e93b06ccf3b0e23934b1ea
5
5
  SHA512:
6
- metadata.gz: 7b23e92f0c9c24c04fd37aa181491e3a19961b47c4a1f6d4e07a9083a56574e946d81d63248dd7704257eeb534530373036a75c3180c4be6c189da34a4f42532
7
- data.tar.gz: a60f06c169dda54985b74b09a94e49be9dae217793900324cd3c0b0d7d30ca1f1b28c2e0040e0b04ad8ea2fd170b9fc8a12a434f7eef4a3b14edd3943a97ec7a
6
+ metadata.gz: 0a8ffc8912d84cc23759a0eccbbcddefa8a6419350e4c49746589ba494b2cb5ce2dcd454ef8341b70f6a5bccb7bf824b42ca6fe140531e5a26e5872548873334
7
+ data.tar.gz: 70a1d6334cc89f34ae169360348acca8bf6905c597c627c5b99909348f4ab8376962931cfa895ef5ecdf6f011ef5f450b4e9e9442c04d021c47c273e1a68d04d
@@ -9,7 +9,7 @@ module ARLeftOverGuardian
9
9
 
10
10
  class Instance
11
11
  def initialize(models)
12
- @models = models.reject(&:abstract_class?)
12
+ @models = models.reject(&method(:abstract?))
13
13
  @counts = current_counts
14
14
  end
15
15
 
@@ -39,6 +39,10 @@ module ARLeftOverGuardian
39
39
  }
40
40
  end
41
41
 
42
+ def abstract?(model)
43
+ model.respond_to?(:abstract_class?) && model.abstract_class?
44
+ end
45
+
42
46
  def reset_model(model)
43
47
  RSpec::Mocks.space.proxy_for(model).reset if defined?(RSpec::Mocks)
44
48
  model
@@ -1,3 +1,3 @@
1
1
  module ARLeftOverGuardian
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -16,7 +16,13 @@ end
16
16
  class FakeModel < FakeWithCount; self.abstract_class = false; end
17
17
  class OtherFakeModel < FakeWithCount; self.abstract_class = false; end
18
18
 
19
- MODELS = [FakeWithCount, FakeModel, OtherFakeModel]
19
+ class NonARModel
20
+ def self.count
21
+ 4
22
+ end
23
+ end
24
+
25
+ MODELS = [FakeWithCount, FakeModel, OtherFakeModel, NonARModel]
20
26
 
21
27
  module CountFaker
22
28
  def fake_count(count, opts={})
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ar_left_over_guardian
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Fedorov