ransack_ui 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ransack_ui.rb +1 -1
- data/lib/ransack_ui/version.rb +1 -1
- data/ransack_ui.gemspec +1 -1
- metadata +7 -8
- data/lib/ransack_ui/ransack_overrides/nodes/value.rb +0 -32
data/lib/ransack_ui.rb
CHANGED
data/lib/ransack_ui/version.rb
CHANGED
data/ransack_ui.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ransack_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,13 +12,13 @@ cert_chain: []
|
|
12
12
|
date: 2012-11-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: ransack_chronic
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0
|
21
|
+
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0
|
29
|
+
version: '0'
|
30
30
|
description: Framework for building a search UI with Ransack
|
31
31
|
email:
|
32
32
|
- nathan.f77@gmail.com
|
@@ -59,7 +59,6 @@ files:
|
|
59
59
|
- lib/ransack_ui/ransack_overrides/configuration.rb
|
60
60
|
- lib/ransack_ui/ransack_overrides/context.rb
|
61
61
|
- lib/ransack_ui/ransack_overrides/helpers/form_builder.rb
|
62
|
-
- lib/ransack_ui/ransack_overrides/nodes/value.rb
|
63
62
|
- lib/ransack_ui/version.rb
|
64
63
|
- lib/ransack_ui/view_helpers.rb
|
65
64
|
- ransack_ui.gemspec
|
@@ -78,7 +77,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
78
77
|
version: '0'
|
79
78
|
segments:
|
80
79
|
- 0
|
81
|
-
hash:
|
80
|
+
hash: 3737585242911340372
|
82
81
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
82
|
none: false
|
84
83
|
requirements:
|
@@ -87,10 +86,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
86
|
version: '0'
|
88
87
|
segments:
|
89
88
|
- 0
|
90
|
-
hash:
|
89
|
+
hash: 3737585242911340372
|
91
90
|
requirements: []
|
92
91
|
rubyforge_project:
|
93
|
-
rubygems_version: 1.8.
|
92
|
+
rubygems_version: 1.8.24
|
94
93
|
signing_key:
|
95
94
|
specification_version: 3
|
96
95
|
summary: UI Builder for Ransack
|
@@ -1,32 +0,0 @@
|
|
1
|
-
require 'ransack/nodes'
|
2
|
-
|
3
|
-
# Add Chronic parsing to date and time casting
|
4
|
-
module Ransack
|
5
|
-
module Nodes
|
6
|
-
Value.class_eval do
|
7
|
-
def cast_to_date(val)
|
8
|
-
if val.is_a?(String)
|
9
|
-
Chronic.parse(val).in_time_zone.to_date rescue nil
|
10
|
-
elsif val.respond_to?(:to_date)
|
11
|
-
val.to_date rescue nil
|
12
|
-
else
|
13
|
-
y, m, d = *[val].flatten
|
14
|
-
m ||= 1
|
15
|
-
d ||= 1
|
16
|
-
Date.new(y,m,d) rescue nil
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
def cast_to_time(val)
|
21
|
-
if val.is_a?(Array)
|
22
|
-
Time.zone.local(*val) rescue nil
|
23
|
-
else
|
24
|
-
unless val.acts_like?(:time)
|
25
|
-
val = val.is_a?(String) ? Chronic.parse(val) : val.to_time rescue nil
|
26
|
-
end
|
27
|
-
val.in_time_zone rescue nil
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|