activerecord-database_validations 1.0.0 → 1.0.1

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
  SHA1:
3
- metadata.gz: 5fe2382415d03dd7e2f8b7006bb505d7da55e42a
4
- data.tar.gz: 4e6a436ce619c8ef1c79d3c98f7ac970d6020c9d
3
+ metadata.gz: 37d43982bebae9ffbb5ee96d8ae1081c183ae36c
4
+ data.tar.gz: 90a3f5256fd0f522444cb457ebea9c9d88a3c6c1
5
5
  SHA512:
6
- metadata.gz: 0e4cdca4c51a1b083e72708fb908bfb01edb31fcb0e70017b511d4f0f5bd63a50d5970be1b075714a4a31a9a497c14c0e37a9d026f5d88d4830dbb310df24a45
7
- data.tar.gz: bc7b4ccbe3525ed20a4a4d931d37fcf0a1adb8d045fd47d65166f0674da7e7655a82911d997b226cd1ea7f735e53570c9a19ecda6c1607fd1056ae96ff415d95
6
+ metadata.gz: 6a2a4c0729fd1b7c9653bc4e83fc111a57fd910c9652a763ac8597ad970f888f0ac2612ef01a981747b0724890ca70321f5920b574521f2932fbc5a08f3868ea
7
+ data.tar.gz: 7a7f892f2b354b3786bc0aa1ea07419c5094ee7d34806a1879aa6ffdab2a3d5cc78c810195ffb2c6abbf59a2823d0164f9183b5ff97816cb1076a91aa40ce642
@@ -5,8 +5,10 @@ module ActiveRecord::DatabaseValidations::Validations
5
5
  validates_database_foreign_key
6
6
  end
7
7
 
8
+ NOT_NULL_IGNORED = ['created_at', 'updated_at']
8
9
  def validates_database_not_null(options = {})
9
10
  columns.reject(&:null).each do |column|
11
+ next if NOT_NULL_IGNORED.include?(column.name)
10
12
  validation = proc do
11
13
  if self[column.name].nil?
12
14
  errors.add(column.name, options[:message] || :blank)
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module DatabaseValidations
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-database_validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oded Niv