with_filters 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/changelog.md CHANGED
@@ -1,2 +1,5 @@
1
+ ## 0.1.1
2
+ * fix for contains option
3
+
1
4
  ## 0.1.0
2
5
  * initial release
@@ -79,7 +79,7 @@ module WithFilters
79
79
  end
80
80
 
81
81
  field_options = {}
82
- field_options = options[:fields][field] if options[:fields] and options[:fields][field]
82
+ field_options = options[:fields][field.to_sym] if options[:fields] and options[:fields][field.to_sym]
83
83
 
84
84
  if field_options.is_a?(Proc)
85
85
  relation = field_options.call(value, relation)
@@ -100,7 +100,7 @@ module WithFilters
100
100
  when :Array
101
101
  relation.where([Array.new(value.size, "#{quoted_field} LIKE ?").join(' OR '), *value])
102
102
  when :Hash
103
- if ![:datetime, :timestamp].include?(relation.with_filters_data[:column_types][field]) or Date._parse(value[:start])[:sec_fraction]
103
+ if ![:datetime, :timestamp].include?(relation.with_filters_data[:column_types][field.to_sym]) or Date._parse(value[:start])[:sec_fraction]
104
104
  relation.where(["#{quoted_field} BETWEEN :start AND :stop", value])
105
105
  else
106
106
  relation.where(["#{quoted_field} >= :start AND #{quoted_field} < :stop", value])
@@ -1,3 +1,3 @@
1
1
  module WithFilters
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: with_filters
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-15 00:00:00.000000000 Z
12
+ date: 2012-04-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70092264546940 !ruby/object:Gem::Requirement
16
+ requirement: &70211722479240 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70092264546940
24
+ version_requirements: *70211722479240
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec-rails
27
- requirement: &70092264545600 !ruby/object:Gem::Requirement
27
+ requirement: &70211722477540 !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: *70092264545600
35
+ version_requirements: *70211722477540
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: sqlite3
38
- requirement: &70092264544020 !ruby/object:Gem::Requirement
38
+ requirement: &70211722373480 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70092264544020
46
+ version_requirements: *70211722373480
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: genspec
49
- requirement: &70092264534380 !ruby/object:Gem::Requirement
49
+ requirement: &70211722371980 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70092264534380
57
+ version_requirements: *70211722371980
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: capybara
60
- requirement: &70092264532500 !ruby/object:Gem::Requirement
60
+ requirement: &70211722371120 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70092264532500
68
+ version_requirements: *70211722371120
69
69
  description: Add filtering to lists, tables, etc.
70
70
  email:
71
71
  - aaron.lasseigne@gmail.com
@@ -195,7 +195,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
195
195
  version: '0'
196
196
  segments:
197
197
  - 0
198
- hash: -161425369091946249
198
+ hash: 537189480172607025
199
199
  required_rubygems_version: !ruby/object:Gem::Requirement
200
200
  none: false
201
201
  requirements:
@@ -204,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
204
  version: '0'
205
205
  segments:
206
206
  - 0
207
- hash: -161425369091946249
207
+ hash: 537189480172607025
208
208
  requirements: []
209
209
  rubyforge_project: with_filters
210
210
  rubygems_version: 1.8.11