valhammer 0.1.1 → 0.1.2

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: db1cabb3ee1b18be9f92f9853620457505b28313
4
- data.tar.gz: 7f793f56fd7cc961824d3239bad6a0ad05cf05b9
3
+ metadata.gz: 9465d328d445632ab2a2607b8cac901393548f32
4
+ data.tar.gz: d55c0bd7a8175139e6ad219a11ee8deacb04a92e
5
5
  SHA512:
6
- metadata.gz: e173041be8467d80bbb59a922bfb08c3c46ed8028c80ec36ae24d59019c99d360247859872cb2c5d8c8d9069188b692610bf8a4674434b61dbb17ef23380ea30
7
- data.tar.gz: 1cd7c99c9d11dbcd3f43810c0be4f650d74b08764afb4c400a4872d6e0fce61a9a1ce9d8434b42f3cfcd89856dde43f4671a2313e706017a0086ed0d941f21b4
6
+ metadata.gz: 4d957f2d9ffbd8bb863de67b61fdd4e169c96e879c0e1439d0ddb6566f9a3806ba11a35b6419bbaeb2c9a255310670f2da3738fa18e4483e895d0da119711d51
7
+ data.tar.gz: 8073eb0f3aa152003e81b1f76d5fdd19f6eba9d5d1c9b4e48967bce9175287750769c3a30b91e1be94c6c5ffee0034a6efdcb479bdcf01c8ae04997461c7d6f2
@@ -56,7 +56,7 @@ module Valhammer
56
56
  def valhammer_inclusion(validations, column, opts)
57
57
  return unless opts[:inclusion] && column.type == :boolean
58
58
 
59
- validations[:inclusion] = { in: [false, true], allow_nil: true }
59
+ validations[:inclusion] = { in: [false, true], allow_nil: column.null }
60
60
  end
61
61
 
62
62
  def valhammer_unique(validations, column, opts)
@@ -1,3 +1,3 @@
1
1
  module Valhammer
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
@@ -38,7 +38,7 @@ RSpec.describe Valhammer::Validations do
38
38
  end
39
39
 
40
40
  context 'with a non-nullable boolean' do
41
- let(:opts) { { in: [false, true], allow_nil: true } }
41
+ let(:opts) { { in: [false, true], allow_nil: false } }
42
42
 
43
43
  it { is_expected.to include(a_validator_for(:injected, :inclusion, opts)) }
44
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: valhammer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shaun Mangelsdorf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-04 00:00:00.000000000 Z
11
+ date: 2015-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -218,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
218
  version: '0'
219
219
  requirements: []
220
220
  rubyforge_project:
221
- rubygems_version: 2.2.2
221
+ rubygems_version: 2.4.5
222
222
  signing_key:
223
223
  specification_version: 4
224
224
  summary: Automatically validate ActiveRecord models based on the database schema.