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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5450d62d32a21683b6226c4b1a23694e0dac270987c78e5a5a4452271a55fd08
|
4
|
+
data.tar.gz: ef18b964d35d5796b193c2ffde31698d33fd083a4d3fa03d3f486cef418aa9ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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) &&
|
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}#
|
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)
|
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.
|
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-
|
11
|
+
date: 2022-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|