active_scaffold 3.4.42 → 3.4.43
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +3 -0
- data/lib/active_scaffold/finder.rb +2 -1
- data/lib/active_scaffold/helpers/human_condition_helpers.rb +5 -2
- data/lib/active_scaffold/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c89a2575bfac755ce70fde2774b15e2a4ee4290
|
4
|
+
data.tar.gz: 47f69051b49d59a150b04c81c74d151452d1c629
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8ac30db93e48681891cea00067f401ac8327f7ec139c38d8e5cccebbb493a7e5bbc535a5c1536d0666c768e60032de15f604b7c98274e02df0716c2d49f8304
|
7
|
+
data.tar.gz: f0f0300ea76e0a5c78e8839d2d3a18eb47f99f076319988f187992c95f05c1a40e4b0e3e8dbe46ab9861a34c97c4dffbbf488959ca085289370a56fe30e283ca
|
data/CHANGELOG
CHANGED
@@ -138,7 +138,8 @@ module ActiveScaffold
|
|
138
138
|
|
139
139
|
def condition_value_for_datetime(column, value, conversion = :to_time)
|
140
140
|
if value.is_a? Hash
|
141
|
-
Time.zone.local(*[:year, :month, :day, :hour, :minute, :second].collect { |part| value[part].to_i }) rescue nil
|
141
|
+
time = Time.zone.local(*[:year, :month, :day, :hour, :minute, :second].collect { |part| value[part].to_i }) rescue nil
|
142
|
+
time.send(conversion) if time
|
142
143
|
elsif value.respond_to?(:strftime)
|
143
144
|
if conversion == :to_time
|
144
145
|
# Explicitly get the current zone, because TimeWithZone#to_time in rails 3.2.3 returns UTC.
|
@@ -17,6 +17,7 @@ module ActiveScaffold
|
|
17
17
|
|
18
18
|
def format_human_condition(column, opt, from = nil, to = nil)
|
19
19
|
attribute = column.active_record_class.human_attribute_name(column.name)
|
20
|
+
opt ||= from && to ? :between : (from ? :'>=' : :'<=')
|
20
21
|
"#{attribute} #{as_(opt).downcase} #{from} #{to}"
|
21
22
|
end
|
22
23
|
|
@@ -36,8 +37,10 @@ module ActiveScaffold
|
|
36
37
|
|
37
38
|
def active_scaffold_human_condition_date(column, value)
|
38
39
|
conversion = column.column.type == :date ? :to_date : :to_time
|
39
|
-
from =
|
40
|
-
|
40
|
+
from = controller.class.condition_value_for_datetime(column, value['from'], conversion)
|
41
|
+
from = I18n.l from if from
|
42
|
+
to = controller.class.condition_value_for_datetime(column, value['to'], conversion) if value['opt'] == 'BETWEEN' || (value['opt'].nil? && value['to'])
|
43
|
+
to = "- #{I18n.l to}" if to
|
41
44
|
format_human_condition column, value['opt'], from, to
|
42
45
|
end
|
43
46
|
alias_method :active_scaffold_human_condition_time, :active_scaffold_human_condition_date
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_scaffold
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.43
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Many, see README
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|