simple_record 1.3.8 → 1.3.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.
- data/lib/simple_record/results_array.rb +9 -2
- metadata +4 -4
@@ -24,6 +24,7 @@ module SimpleRecord
|
|
24
24
|
load_to(@options[:per_page] * @options[:page])
|
25
25
|
@start_at = @options[:per_page] * (@options[:page] - 1)
|
26
26
|
end
|
27
|
+
# puts 'RESULTS_ARRAY=' + self.inspect
|
27
28
|
end
|
28
29
|
|
29
30
|
def << (val)
|
@@ -83,9 +84,13 @@ module SimpleRecord
|
|
83
84
|
return @items.size
|
84
85
|
end
|
85
86
|
return @count if @count
|
86
|
-
|
87
|
+
# puts '@params=' + @params.inspect
|
88
|
+
params_for_count = @params.dup
|
87
89
|
params_for_count[0] = :count
|
90
|
+
params_for_count[1] = params_for_count[1].dup # for deep clone
|
88
91
|
params_for_count[1].delete(:limit)
|
92
|
+
|
93
|
+
# puts '@params2=' + @params.inspect
|
89
94
|
# puts 'params_for_count=' + params_for_count.inspect
|
90
95
|
@count = clz.find(*params_for_count)
|
91
96
|
# puts '@count=' + @count.to_s
|
@@ -102,7 +107,9 @@ module SimpleRecord
|
|
102
107
|
|
103
108
|
def each2(i, &blk)
|
104
109
|
options = @params[1]
|
110
|
+
# puts 'options=' + options.inspect
|
105
111
|
limit = options[:limit]
|
112
|
+
# puts 'limit=' + limit.inspect
|
106
113
|
|
107
114
|
@items[i..@items.size].each do |v|
|
108
115
|
# puts "i=" + i.to_s
|
@@ -128,7 +135,7 @@ module SimpleRecord
|
|
128
135
|
# for will_paginate support
|
129
136
|
def total_pages
|
130
137
|
#puts 'total_pages'
|
131
|
-
puts @params[1][:per_page].to_s
|
138
|
+
# puts @params[1][:per_page].to_s
|
132
139
|
return 1 if @params[1][:per_page].nil?
|
133
140
|
ret = (size / @params[1][:per_page].to_f).ceil
|
134
141
|
#puts 'ret=' + ret.to_s
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 1.3.
|
9
|
+
- 9
|
10
|
+
version: 1.3.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Travis Reeder
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2010-06-
|
20
|
+
date: 2010-06-03 00:00:00 -07:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|