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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f85e22fd8b8ed0d15b333d211f081e24ee2484d6
4
- data.tar.gz: 8b490194e7d7adc60a00d0a3c14d718948078c69
3
+ metadata.gz: 3a46edc1511bb6fce264d9a5501dbd457988f3a2
4
+ data.tar.gz: 861d1f3c682de2f0f2679ef0d037d9e728a48db6
5
5
  SHA512:
6
- metadata.gz: 4e238be107e91bde560a8eef3e60ce62d5018c3918a03779c3782f12f770e47ee68bafa96253b520629f437630e2e828f5e88266eb545117378024435fef4099
7
- data.tar.gz: faf799e2a71c5c80fa71f6c8bd0f2fe84b580e01b793f52ac259520d90b2a5bc4e890383553e560a596f0c2388677c2935fa44febc3e97da9dd69f398fc7de1f
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
@@ -104,6 +104,10 @@ top: 19px;
104
104
  top: 14px;
105
105
  }
106
106
 
107
+ .active-scaffold .active-scaffold .active-scaffold-header div.actions .action_group ul ul {
108
+ top: -3px;
109
+ }
110
+
107
111
  .active-scaffold-header div.actions a.disabled {
108
112
  opacity: 0.5;
109
113
  }
@@ -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(ActiveScaffold::Config::Delete.link) unless active_scaffold_config.action_links['delete']
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 then ActiveRecord::ConnectionAdapters::Column.value_to_decimal(value)
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[: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
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[:opt]) || value[:opt]
33
- to = "- #{value[:to]}" if opt == 'BETWEEN'
34
- format_human_condition column, opt, "'#{value[:from]}'", to
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[: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
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[:opt], (values[:from].blank? ? nil : values[:from]), (values[:to].blank? ? nil : values[:to])]
158
+ [values['opt'], values['from'].presence, values['to'].presence]
159
159
  end
160
160
 
161
161
  def active_scaffold_search_range_string?(column)
@@ -2,7 +2,7 @@ module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 4
5
- PATCH = 38
5
+ PATCH = 39
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
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.38
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-05-27 00:00:00.000000000 Z
11
+ date: 2016-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler