datagrid 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.1
1
+ 0.5.2
data/datagrid.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "datagrid"
8
- s.version = "0.5.1"
8
+ s.version = "0.5.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Bogdan Gusiev"]
@@ -16,10 +16,10 @@ module Datagrid
16
16
  from_options = normalize_composite_filter_options(from_options, field)
17
17
  to_options = normalize_composite_filter_options(to_options, field)
18
18
 
19
- filter(from_options[:name] || :"from_#{field}", :date) do |date|
19
+ filter(from_options[:name] || :"from_#{field}", :date, from_options) do |date|
20
20
  driver.greater_equal(self, field, date)
21
21
  end
22
- filter(to_options[:name] || :"to_#{field}", :date) do |date|
22
+ filter(to_options[:name] || :"to_#{field}", :date, to_options) do |date|
23
23
  driver.less_equal(self, field, date)
24
24
  end
25
25
  end
@@ -27,10 +27,10 @@ module Datagrid
27
27
  def integer_range_filters(field, from_options = {}, to_options = {})
28
28
  from_options = normalize_composite_filter_options(from_options, field)
29
29
  to_options = normalize_composite_filter_options(to_options, field)
30
- filter(from_options[:name] || :"from_#{field}", :integer) do |value|
30
+ filter(from_options[:name] || :"from_#{field}", :integer, from_options) do |value|
31
31
  driver.greater_equal(self, field, value)
32
32
  end
33
- filter(to_options[:name] || :"to_#{field}", :integer) do |value|
33
+ filter(to_options[:name] || :"to_#{field}", :integer, to_options) do |value|
34
34
  driver.less_equal(self, field, value)
35
35
  end
36
36
  end
@@ -16,6 +16,14 @@ describe Datagrid::Filters::CompositeFilters do
16
16
  assets.should include(e2)
17
17
  assets.should_not include(e1, e3)
18
18
  end
19
+
20
+ it "should support options" do
21
+ report = test_report do
22
+ report = date_range_filters(:shipping_date, {:default => 10.days.ago.to_date}, {:default => Date.today})
23
+ end
24
+ report.from_shipping_date.should == 10.days.ago.to_date
25
+ report.to_shipping_date.should == Date.today
26
+ end
19
27
  end
20
28
 
21
29
  describe ".integer_range_filters" do
@@ -32,5 +40,12 @@ describe Datagrid::Filters::CompositeFilters do
32
40
  assets.should include(e2)
33
41
  assets.should_not include(e1, e3)
34
42
  end
43
+ it "should support options" do
44
+ report = test_report do
45
+ report = integer_range_filters(:group_id, {:default => 0}, {:default => 100})
46
+ end
47
+ report.from_group_id.should == 0
48
+ report.to_group_id.should == 100
49
+ end
35
50
  end
36
51
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datagrid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &75484050 !ruby/object:Gem::Requirement
16
+ requirement: &78305030 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *75484050
24
+ version_requirements: *78305030
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &75483760 !ruby/object:Gem::Requirement
27
+ requirement: &78304740 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *75483760
35
+ version_requirements: *78304740
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bundler
38
- requirement: &75483430 !ruby/object:Gem::Requirement
38
+ requirement: &78304410 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.0.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *75483430
46
+ version_requirements: *78304410
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: jeweler
49
- requirement: &75483070 !ruby/object:Gem::Requirement
49
+ requirement: &78304050 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.6.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *75483070
57
+ version_requirements: *78304050
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: ruby-debug
60
- requirement: &75482550 !ruby/object:Gem::Requirement
60
+ requirement: &78303520 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *75482550
68
+ version_requirements: *78303520
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: mocha
71
- requirement: &75481780 !ruby/object:Gem::Requirement
71
+ requirement: &78302760 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *75481780
79
+ version_requirements: *78302760
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rspec
82
- requirement: &75481530 !ruby/object:Gem::Requirement
82
+ requirement: &78302520 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - =
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 2.6.0
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *75481530
90
+ version_requirements: *78302520
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: accept_values_for
93
- requirement: &75481140 !ruby/object:Gem::Requirement
93
+ requirement: &78302120 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *75481140
101
+ version_requirements: *78302120
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: nokogiri
104
- requirement: &75480800 !ruby/object:Gem::Requirement
104
+ requirement: &78301780 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *75480800
112
+ version_requirements: *78301780
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: sqlite3-ruby
115
- requirement: &75480480 !ruby/object:Gem::Requirement
115
+ requirement: &78301460 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: '0'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *75480480
123
+ version_requirements: *78301460
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: will_paginate
126
- requirement: &75480110 !ruby/object:Gem::Requirement
126
+ requirement: &78301090 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - =
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: 2.3.15
132
132
  type: :development
133
133
  prerelease: false
134
- version_requirements: *75480110
134
+ version_requirements: *78301090
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: mongoid
137
- requirement: &75479780 !ruby/object:Gem::Requirement
137
+ requirement: &78300760 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - =
@@ -142,10 +142,10 @@ dependencies:
142
142
  version: 2.2.2
143
143
  type: :development
144
144
  prerelease: false
145
- version_requirements: *75479780
145
+ version_requirements: *78300760
146
146
  - !ruby/object:Gem::Dependency
147
147
  name: bson
148
- requirement: &75479190 !ruby/object:Gem::Requirement
148
+ requirement: &78300170 !ruby/object:Gem::Requirement
149
149
  none: false
150
150
  requirements:
151
151
  - - =
@@ -153,10 +153,10 @@ dependencies:
153
153
  version: 1.4.0
154
154
  type: :development
155
155
  prerelease: false
156
- version_requirements: *75479190
156
+ version_requirements: *78300170
157
157
  - !ruby/object:Gem::Dependency
158
158
  name: bson_ext
159
- requirement: &75478930 !ruby/object:Gem::Requirement
159
+ requirement: &78299910 !ruby/object:Gem::Requirement
160
160
  none: false
161
161
  requirements:
162
162
  - - =
@@ -164,10 +164,10 @@ dependencies:
164
164
  version: 1.4.0
165
165
  type: :development
166
166
  prerelease: false
167
- version_requirements: *75478930
167
+ version_requirements: *78299910
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: fastercsv
170
- requirement: &75478570 !ruby/object:Gem::Requirement
170
+ requirement: &78299560 !ruby/object:Gem::Requirement
171
171
  none: false
172
172
  requirements:
173
173
  - - ! '>='
@@ -175,7 +175,7 @@ dependencies:
175
175
  version: '0'
176
176
  type: :development
177
177
  prerelease: false
178
- version_requirements: *75478570
178
+ version_requirements: *78299560
179
179
  description: This allows you to easily build datagrid aka data tables with sortable
180
180
  columns and filters
181
181
  email: agresso@gmail.com
@@ -258,7 +258,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
258
258
  version: '0'
259
259
  segments:
260
260
  - 0
261
- hash: -141785713
261
+ hash: -972605005
262
262
  required_rubygems_version: !ruby/object:Gem::Requirement
263
263
  none: false
264
264
  requirements: