frozen_record 0.2.0 → 0.3.0

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: 3d5bf57cf0db1528c16e891539181a4a5656be02
4
- data.tar.gz: b956af651e5cfd433e5dd34d8587b47f0df5da74
3
+ metadata.gz: ddd2c7d5a3193c955747df36c966af51301a635f
4
+ data.tar.gz: 1d8ca8bd18703b5e6a0ab7d6009b3c4c942cf0d9
5
5
  SHA512:
6
- metadata.gz: f5b16b551e331aa03982c77b380a7ed8481c81b75a7447c4fd21a491dec9872d773bc00f45b6678d47ae4dfbde8ac1bff303a507a4fbd30f3aaa7d8f63f145cd
7
- data.tar.gz: 1774b28d79b17b87244c73b608a9981219d90c0448ebfa625e6adbc451e43dad057fd77afb33fcff0e1d42b29bc7c4199faa9282819f07354f5e6cd65e151c9e
6
+ metadata.gz: 6087f508fd4dff8578a36f9d79a7cf04aa714d1a44df723be848863f5ac492e8e291dede1249802b5b18ab4e158c6baf7ec7e1ebc8986aa547a3e0315a13c71c
7
+ data.tar.gz: 790171c1c06b52001c53e2e7a2447acb8ad44cfb4f95f5cc4dcb8fcf4d2b26fed286afe9090847f46c06f959a6d7cf2007635fd314fb6d093490a748d41a56d2
@@ -61,6 +61,10 @@ module FrozenRecord
61
61
  end
62
62
  end
63
63
 
64
+ def count
65
+ load_records.size
66
+ end
67
+
64
68
  private
65
69
 
66
70
  def store
@@ -1,3 +1,3 @@
1
1
  module FrozenRecord
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
@@ -45,7 +45,7 @@ describe FrozenRecord::Base do
45
45
  expect(attributes).to be == {
46
46
  'id' => 1,
47
47
  'name' => 'Canada',
48
- 'capital' => 'Ottawa',
48
+ 'capital' => 'Ottawa',
49
49
  'density' => 3.5,
50
50
  'population' => 33.88,
51
51
  'founded_on' => Date.parse('1867-07-01'),
@@ -97,4 +97,15 @@ describe FrozenRecord::Base do
97
97
 
98
98
  end
99
99
 
100
+ describe '#count' do
101
+
102
+ it 'can count objects with no records' do
103
+ expect(Car.count).to be 0
104
+ end
105
+
106
+ it 'can count objects with records' do
107
+ expect(Country.count).to be 3
108
+ end
109
+
110
+ end
100
111
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frozen_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-18 00:00:00.000000000 Z
11
+ date: 2014-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel