perpetuity 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## Version 0.4.2
2
+
3
+ - Improved speed and stability of `Mapper#first` and `Mapper#all`
4
+
1
5
  ## Version 0.4.1
2
6
 
3
7
  - Add `Mapper#remove_index!` to remove DB indexes
@@ -94,24 +94,11 @@ module Perpetuity
94
94
  end
95
95
 
96
96
  def first
97
- data = data_source.first mapped_class
98
- object = mapped_class.new
99
- inject_data object, data
100
-
101
- object
97
+ retrieve.limit(1).first
102
98
  end
103
99
 
104
100
  def all
105
- results = data_source.all mapped_class
106
- objects = []
107
- results.each do |result|
108
- object = mapped_class.new
109
- inject_data object, result
110
-
111
- objects << object
112
- end
113
-
114
- objects
101
+ retrieve
115
102
  end
116
103
 
117
104
  def retrieve criteria={}
@@ -1,3 +1,3 @@
1
1
  module Perpetuity
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: perpetuity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-05 00:00:00.000000000 Z
12
+ date: 2013-01-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake