morse_fields_validator 1.1.3 → 1.1.4

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: 4fe06e2f9e200c95292fa20ee2ecd24c6e443d5b
4
- data.tar.gz: 80569b8ced1ae3ca88e586239e82afbc13ad6e1f
3
+ metadata.gz: 772c87166c71d64095891661212b6f7fa2c5bab6
4
+ data.tar.gz: ec28227fd013659d54cb7c2e06f874f18571007f
5
5
  SHA512:
6
- metadata.gz: 20d903d3de3618412f1c94b00e3b8d8b8552458cd58992fb7575a505ceb2ba8cd06ccf77e0cb75787465d2bee531e6e73b6512916202cfa5c9fe4ca2f110dbac
7
- data.tar.gz: 14c1e07cbc593da2c0bc01357b47792a2a2772b1f98384dc758862e68f43a774c2158c3c749b79d33879a106ff8fb5c2cfa2a6ad44e03ae3083f7df80f2984e2
6
+ metadata.gz: 9eab1cbcf3c0248ca6fc3f30565c1b46bdb7768741738649e4558ef16b87c78db34eddd0390ad52afb18afb133cd5f040550a81164bece4876096d1130adf8fc
7
+ data.tar.gz: 204dea299691ecb6136fe820bea7069f1e0fe3e994d3c65b20f7f08f80b14ad8fa053cd77508739ead0d58a6b123dc65c1bf4f673a87c4d6463763707effb423
@@ -1,3 +1,3 @@
1
1
  module MorseFieldsValidator
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
3
3
  end
@@ -1,4 +1,4 @@
1
1
  require 'active_model'
2
2
  require 'active_support/all'
3
3
  require "morse_fields_validator/version"
4
- require "morse_fields_validator/fields_validator"
4
+ require "fields_validator"
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.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Terry S
@@ -156,7 +156,6 @@ files:
156
156
  - bin/console
157
157
  - bin/setup
158
158
  - lib/morse_fields_validator.rb
159
- - lib/morse_fields_validator/fields_validator.rb
160
159
  - lib/morse_fields_validator/version.rb
161
160
  - morse_fields_validator.gemspec
162
161
  homepage: https://github.com/morsedigital/morse_fields_validator
@@ -1,31 +0,0 @@
1
- module FieldsValidator
2
-
3
- extend ActiveSupport::Concern
4
-
5
- included do
6
- validate :validate_column_names if respond_to?(:validate)
7
- end
8
-
9
- class_methods do
10
- def validate_required_attributes
11
- required_attributes.each do |a|
12
- validates a.to_sym, presence: true
13
- end if required_attributes.any?
14
- end
15
-
16
- def required_attributes
17
- (defined?(super) and super.is_a?(Array)) ? super : []
18
- end
19
-
20
- def required_database_fields
21
- (defined?(super) and super.is_a?(Array)) ? super : []
22
- end
23
-
24
- end
25
-
26
- private
27
-
28
- def validate_column_names
29
- self.class.required_database_fields.each { |rdf| errors_add(rdf, "does not have a column in the database.") unless self.class.column_names.include?(rdf)} if self.class.required_database_fields.any?
30
- end
31
- end