bootstrap_validator_rails 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4e780af12bf0585ce5098c8116eb2809abe67566
4
- data.tar.gz: e94b6330c4a6cf18143518c504486d90ec35c67f
3
+ metadata.gz: 17bf5fba7766d8d384757dcf4508412bb2aaede4
4
+ data.tar.gz: 3f8a4feddc93d5b330f2fd472e6362d44d1ffe80
5
5
  SHA512:
6
- metadata.gz: 1113fb61f99d957cde4cc9bb311b908f7df89433b142435c59c57b6c2e91ff4f8331324c0ba7b49ffc0fe0e05034a4e651a46a484e583554ee103cd0a722caa9
7
- data.tar.gz: 03f841a2da5df1f1ec5a6a2286224aa491e67b5a62002661263999e2cd21cde7a9a428b3dd073f570a9fc7a6d3fd09cddcc835d916310fd96a0290cfbbe8e50e
6
+ metadata.gz: 0cc4f39b0b66d2b6249fc552ede911a04b2e621e172d766e48a7e0aab5fae1ef2cae56214f5977a6e91718b5637c125cfea8f8cee229d305a8626b34793da427
7
+ data.tar.gz: ed31e239fac037c907ec6cc7451c3bf49f6bc48737f74e56c27563f6ea322b057bdcf1add9f2c5bca85fee28ae3f56a85e5b8355307489943d5261891e243efa
@@ -49,6 +49,20 @@ module BootstrapValidatorRails
49
49
  data[:bv_lessthan_inclusive] = 'true'
50
50
  data[:bv_lessthan_value] = options[:less_than_or_equal_to]
51
51
  end
52
+
53
+ if options[:odd].present?
54
+ data[:bv_step] = 'true'
55
+ data[:bv_step_message] = 'should be odd'
56
+ data[:bv_step_base] = '1'
57
+ data[:bv_step_step] = '2'
58
+ end
59
+
60
+ if options[:even].present?
61
+ data[:bv_step] = 'true'
62
+ data[:bv_step_message] = 'should be even'
63
+ data[:bv_step_base] = '0'
64
+ data[:bv_step_step] = '2'
65
+ end
52
66
  data
53
67
  end
54
68
  end
@@ -1,3 +1,3 @@
1
1
  module BootstrapValidatorRails
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
@@ -1,5 +1,5 @@
1
1
  class Post < ActiveRecord::Base
2
- validates :title, presence: true, length: {within: 20..50}, numericality: {greater_than_or_equal_to: 20}
2
+ validates :title, presence: true, length: {within: 20..50}, numericality: {greater_than_or_equal_to: 20, odd: true}
3
3
  validates :title, format: { with: /\A[a-zA-Z]+\z/, message: "only allows letters" }
4
4
  validates :intro, presence: true, if: :published?
5
5
  validates :accepted, acceptance: true
@@ -2556,3 +2556,18 @@ BootstrapValidatorRailsTest: test_test_will_be_included_later
2556
2556
  BootstrapValidatorRailsTest: test_test_will_be_included_later
2557
2557
  -------------------------------------------------------------
2558
2558
   (0.1ms) rollback transaction
2559
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
2560
+  (0.1ms) begin transaction
2561
+  (0.1ms) rollback transaction
2562
+  (0.1ms) begin transaction
2563
+  (0.1ms) rollback transaction
2564
+  (0.1ms) begin transaction
2565
+  (0.0ms) rollback transaction
2566
+  (0.0ms) begin transaction
2567
+  (0.1ms) rollback transaction
2568
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2569
+  (0.1ms) begin transaction
2570
+  (0.1ms) rollback transaction
2571
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2572
+  (0.1ms) begin transaction
2573
+  (0.1ms) rollback transaction
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap_validator_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - huynhquancam
@@ -66,8 +66,8 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.0'
69
- description: Rails Client-side validation using jQuery BootstrapValidator plugin.
70
- https://github.com/nghuuphuoc/bootstrapvalidator
69
+ description: Rails Form Builder supports Client-side validation using jQuery BootstrapValidator
70
+ plugin. https://github.com/nghuuphuoc/bootstrapvalidator
71
71
  email:
72
72
  - huynhquancam@gmail.com
73
73
  executables: []