wanew_client_validate 0.0.11 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -79,7 +79,15 @@ module WaNew::ClientValidate::ActionView::Helpers
79
79
 
80
80
  def apply_client_validators(method, options = {})
81
81
  if @options[:validate] && options[:validate] != false && validators = filter_validators(@object.client_validation_hash[method], options[:validate])
82
-
82
+ if validators && validators[:inclusion] && validators[:inclusion][:in] && !validators[:inclusion][:in].blank?
83
+ validators[:inclusion][:in] = validators[:inclusion][:in].to_s
84
+ end
85
+ if validators && validators[:format] && validators[:format][:with] && !validators[:format][:with].blank?
86
+ rs = validators[:format][:with].to_s
87
+ ile = rs.length.to_i - 8
88
+ rs = "/#{rs[7,ile]}/"
89
+ validators[:format][:with] = rs
90
+ end
83
91
  options.merge!("validate" => validators.to_json)
84
92
 
85
93
  @options[:validators].merge!("#{@object_name}[#{method}]" => validators)
@@ -1,5 +1,5 @@
1
1
  module WaNew
2
2
  module ClientValidate
3
- VERSION = "0.0.11"
3
+ VERSION = "0.0.14"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wanew_client_validate
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 11
10
- version: 0.0.11
9
+ - 14
10
+ version: 0.0.14
11
11
  platform: ruby
12
12
  authors:
13
13
  - wanliu corporation
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-05-31 00:00:00 +08:00
19
+ date: 2011-06-03 00:00:00 +08:00
20
20
  default_executable:
21
21
  dependencies: []
22
22