active_scaffold 3.6.9 → 3.6.10

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
  SHA256:
3
- metadata.gz: e1e1f178ccfe11c704e5064d0ee50bfa6a27d6aee4f478f478e6e0529a7e0683
4
- data.tar.gz: de3fb5ad387969bc8c796ca9db23de2f311e8b16f6002316456b475953d66ae1
3
+ metadata.gz: 5450d62d32a21683b6226c4b1a23694e0dac270987c78e5a5a4452271a55fd08
4
+ data.tar.gz: ef18b964d35d5796b193c2ffde31698d33fd083a4d3fa03d3f486cef418aa9ef
5
5
  SHA512:
6
- metadata.gz: 175f49bcb07a4fd3fd313f5437b3d2b438a20d9a697e2cc481fcc7086a4a0add3e08fa342ed90f984fed13eff68bad632b8bd772bbbf6869319d1024ace9082d
7
- data.tar.gz: 8db9c02a65266fc858910ecf180800c4adabe0913eb02cb3464db665f51ad3ab3230a5bc1e6d38a581d93a874d390e6e8fa7ae7f72ec5c09d54cbecfcb070a71
6
+ metadata.gz: 84fbaee76d085ccf789bb610e99a652ecabf4c2158a5813a8dba2b493fafd97bf02be6743874942dea47a9b3067b361c534d4faf832e4c007ec854aaddd53b85
7
+ data.tar.gz: c4e5d788ae233d7c853a24d6cadfc2c1e81e963da2abcb763a453e9cb0ef01a7b028de8af45e2943e29784dcbace065b097ca7a396c3d9cc9bf444955e329987
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,9 @@
1
+ = 3.6.10
2
+ - Don't add numerical constraints based on conditional validation
3
+ - Fix typo in cache key for numerical constraints
4
+ - Fix duplicated params in search form, e.g. embedded constraints
5
+
6
+ = 3.6.9
1
7
  - Support depend on .rb or .json locale files for date picker bridge
2
8
  - Fix search with dates entered with timezone in datepicker
3
9
 
@@ -14,7 +14,7 @@
14
14
  hidden_params = url_options.except(:controller, :action, :id, :search).to_query.split(Rack::Utils::DEFAULT_SEP)
15
15
  -%>
16
16
 
17
- <%= form_tag url_options, options do %>
17
+ <%= form_tag url_options.slice(:controller, :action, :id, :search), options do %>
18
18
  <% hidden_params.each do |pair| -%>
19
19
  <% key, value = pair.split('=', 2).map { |str| Rack::Utils.unescape(str) } -%>
20
20
  <%= hidden_field_tag(key, value) %>
@@ -720,7 +720,9 @@ module ActiveScaffold
720
720
  # Try to get numerical constraints from model's validators
721
721
  def column_numerical_constraints(column, options)
722
722
  validators = column.active_record_class.validators.select do |v|
723
- v.is_a?(ActiveModel::Validations::NumericalityValidator) && v.attributes.include?(column.name)
723
+ v.is_a?(ActiveModel::Validations::NumericalityValidator) &&
724
+ v.attributes.include?(column.name) &&
725
+ !v.options[:if] && !v.options[:unless]
724
726
  end
725
727
 
726
728
  equal_validator = validators.find { |v| v.options[:equal_to] }
@@ -770,7 +772,7 @@ module ActiveScaffold
770
772
  end
771
773
 
772
774
  def numerical_constraints_for_column(column, options)
773
- constraints = Rails.cache.fetch("#{column.cache_key}#numerical_constarints") do
775
+ constraints = Rails.cache.fetch("#{column.cache_key}#numerical_constraints") do
774
776
  column_numerical_constraints(column, options)
775
777
  end
776
778
  constraints.merge(options)
@@ -2,7 +2,7 @@ module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 6
5
- PATCH = 9
5
+ PATCH = 10
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.6.9
4
+ version: 3.6.10
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: 2022-05-03 00:00:00.000000000 Z
11
+ date: 2022-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails