morse_fields_validator 1.0.1 → 1.1.0

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: 8abfbc287f81638297be216ba0ba8cdcc2d4d30b
4
- data.tar.gz: 8a1291945bc7bb45b6df25e0f2e8116a93a53aec
3
+ metadata.gz: 480146ad3c18a4216a22a2ee7dde7fb982b591fc
4
+ data.tar.gz: 15c5cbb863e93f848a2b6df97a814d4f2126a78c
5
5
  SHA512:
6
- metadata.gz: 8cb3e0930f2d821e988b5dd8e5a30f4891d5aea07e52b955d5d6ebcd1ace328c7f289acf41c2d69e24e4ecb5f00c6d6b0f739b59824aa0e51f53d8d3e008230d
7
- data.tar.gz: b7f11200a3474bcaaf9daea285e83fc326f20eecded248fb05ce19696edb437dd1753c57314a4c165582e4b34602a44433f2ba126f8766e67aac7fcc71a506d3
6
+ metadata.gz: 1813a4f7e25ea9d86a5c21f766f291590a4eb344c61d167b7f1c0ff3a6b4ee7900c076a123028d31aa77cd5539c1488e30b1e542fab739aca03043b5d17732c3
7
+ data.tar.gz: 5eedb850fdacb13cc7f61347e15f0605957f437c96b61b73a3aaf4393cc097bd24a2b2b242719dc9e2353cd1c0d779b31de81eeba998d1867f7ba5597124dc38
@@ -10,24 +10,21 @@ module FieldsValidator
10
10
  def validate_required_attributes
11
11
  required_attributes.each do |a|
12
12
  validates a.to_sym, presence: true
13
- end
14
- end
15
- def load_required_attributes(*_attrs)
16
- @required_attributes=_attrs.any? ? _attrs : []
17
- @required_attributes.uniq!
13
+ end if required_attributes.any?
18
14
  end
19
15
 
20
16
  def required_attributes
21
- @required_attributes
17
+ defined?(super) ? super : []
22
18
  end
23
- end
24
19
 
25
- private
20
+ def required_database_fields
21
+ defined?(super) ? super : []
22
+ end
26
23
 
27
- def required_database_fields
28
- defined?(super) ? super : []
29
24
  end
30
25
 
26
+ private
27
+
31
28
  def validate_column_names
32
29
  required_database_fields.each { |rdf| errors_add(rdf, "does not have a column in the database.") unless self.class.column_names.include?(rdf)} if required_database_fields.any?
33
30
  end
@@ -1,3 +1,3 @@
1
1
  module MorseFieldsValidator
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: morse_fields_validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Terry S