active_scaffold 3.4.38 → 3.4.39
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +6 -0
- data/app/assets/stylesheets/active_scaffold_layout.css +4 -0
- data/lib/active_scaffold/actions/nested.rb +2 -2
- data/lib/active_scaffold/finder.rb +6 -1
- data/lib/active_scaffold/helpers/human_condition_helpers.rb +9 -9
- data/lib/active_scaffold/helpers/search_column_helpers.rb +2 -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: 3a46edc1511bb6fce264d9a5501dbd457988f3a2
|
4
|
+
data.tar.gz: 861d1f3c682de2f0f2679ef0d037d9e728a48db6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e50e693ef1eb90f8ab74ef85906c5d0529c6c9f27b50d6e2c6cd3325532b7837a4350421357e03f29ffcec384f984634293f996bfb308981b08ac5d8279e936
|
7
|
+
data.tar.gz: b9cd9f61abadffadf976c12b18c95acb729746a42983844b133c25c2341619abaf213480ed67704f20be3ee09b146e5fef2fbbc02f4952cb973116501f8aff8a
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
= 3.4.39
|
2
|
+
- fix removing delete link with config.delete.link = false, broken on 3.4.38
|
3
|
+
- fix position of nested action groups
|
4
|
+
- fix human conditions with rails 4.2 and json session
|
5
|
+
- fix search conditions for decimal columns on rails 4.2
|
6
|
+
|
1
7
|
= 3.4.38
|
2
8
|
- ensure add_existing and delete_existing are removed when list is not nested
|
3
9
|
- add :percentage list_ui, use jquery ui slider, set slider options on column.options[:slider], :value_method (default to column name), :min_method and :max_method to get value, min and max options from record
|
@@ -68,8 +68,8 @@ module ActiveScaffold::Actions
|
|
68
68
|
|
69
69
|
if active_scaffold_config.nested.shallow_delete
|
70
70
|
active_scaffold_config.action_links.delete('destroy_existing') if active_scaffold_config.action_links['destroy_existing']
|
71
|
-
if active_scaffold_config.actions.include?(:delete)
|
72
|
-
active_scaffold_config.action_links.add(
|
71
|
+
if active_scaffold_config.actions.include?(:delete) && active_scaffold_config.delete.link
|
72
|
+
active_scaffold_config.action_links.add(active_scaffold_config.delete.link) unless active_scaffold_config.action_links['delete']
|
73
73
|
end
|
74
74
|
end
|
75
75
|
end
|
@@ -182,7 +182,12 @@ module ActiveScaffold
|
|
182
182
|
case (column.search_ui || column.column.type)
|
183
183
|
when :integer then value.to_i rescue value ? 1 : 0
|
184
184
|
when :float then value.to_f
|
185
|
-
when :decimal
|
185
|
+
when :decimal
|
186
|
+
if Rails.version >= '4.2.0'
|
187
|
+
ActiveRecord::Type::Decimal.new.type_cast_from_user(value)
|
188
|
+
else
|
189
|
+
ActiveRecord::ConnectionAdapters::Column.value_to_decimal(value)
|
190
|
+
end
|
186
191
|
else
|
187
192
|
value
|
188
193
|
end
|
@@ -21,24 +21,24 @@ module ActiveScaffold
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def active_scaffold_human_condition_integer(column, value)
|
24
|
-
from = format_number_value(controller.class.condition_value_for_numeric(column, value[
|
25
|
-
to = "- #{format_number_value(controller.class.condition_value_for_numeric(column, value[
|
26
|
-
format_human_condition column, value[
|
24
|
+
from = format_number_value(controller.class.condition_value_for_numeric(column, value['from']), column.options) if value['from'].present?
|
25
|
+
to = "- #{format_number_value(controller.class.condition_value_for_numeric(column, value['to']), column.options)}" if value['opt'] == 'BETWEEN'
|
26
|
+
format_human_condition column, value['opt'].downcase, from, to
|
27
27
|
end
|
28
28
|
alias_method :active_scaffold_human_condition_decimal, :active_scaffold_human_condition_integer
|
29
29
|
alias_method :active_scaffold_human_condition_float, :active_scaffold_human_condition_integer
|
30
30
|
|
31
31
|
def active_scaffold_human_condition_string(column, value)
|
32
|
-
opt = ActiveScaffold::Finder::STRING_COMPARATORS.key(value[
|
33
|
-
to = "- #{value[
|
34
|
-
format_human_condition column, opt, "'#{value[
|
32
|
+
opt = ActiveScaffold::Finder::STRING_COMPARATORS.key(value['opt']) || value['opt']
|
33
|
+
to = "- #{value['to']}" if opt == 'BETWEEN'
|
34
|
+
format_human_condition column, opt, "'#{value['from']}'", to
|
35
35
|
end
|
36
36
|
|
37
37
|
def active_scaffold_human_condition_date(column, value)
|
38
38
|
conversion = column.column.type == :date ? :to_date : :to_time
|
39
|
-
from = I18n.l controller.condition_value_for_datetime(column, value[
|
40
|
-
to = "- #{I18n.l controller.condition_value_for_datetime(column, value[
|
41
|
-
format_human_condition column, value[
|
39
|
+
from = I18n.l controller.condition_value_for_datetime(column, value['from'], conversion)
|
40
|
+
to = "- #{I18n.l controller.condition_value_for_datetime(column, value['to'], conversion)}" if value['opt'] == 'BETWEEN'
|
41
|
+
format_human_condition column, value['opt'], from, to
|
42
42
|
end
|
43
43
|
alias_method :active_scaffold_human_condition_time, :active_scaffold_human_condition_date
|
44
44
|
alias_method :active_scaffold_human_condition_datetime, :active_scaffold_human_condition_date
|
@@ -153,9 +153,9 @@ module ActiveScaffold
|
|
153
153
|
end
|
154
154
|
|
155
155
|
def field_search_params_range_values(column)
|
156
|
-
values = field_search_params[column.name]
|
156
|
+
values = field_search_params[column.name.to_s]
|
157
157
|
return nil unless values.is_a? Hash
|
158
|
-
[values[
|
158
|
+
[values['opt'], values['from'].presence, values['to'].presence]
|
159
159
|
end
|
160
160
|
|
161
161
|
def active_scaffold_search_range_string?(column)
|
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.39
|
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: 2016-
|
11
|
+
date: 2016-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|