jet_set 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
  SHA256:
3
- metadata.gz: 41fe70bc858f2949d8cf010b6af40066a84bdfdf481f0fef13dfdb49fca1de46
4
- data.tar.gz: 02c77cd6a4741a0be81caa52e3c3b63b75722cddffbd289497a194701d60c447
3
+ metadata.gz: 8614ade8230cd3023525ec3c6813b4d78fbdd384bfa8cc687f0b73de29223b2e
4
+ data.tar.gz: bfee48c3fee0fa86787eddb8f778662ada1ff1edaf7832af2f3d4f4328be3556
5
5
  SHA512:
6
- metadata.gz: 99ca355278cad5427c3b69228806f7405e4725a2d2acf1c5902fdf488a7e2acf5a29ee509e93ace75cdae86ba6a596fa79493d848b62acff90977cf00a04e864
7
- data.tar.gz: 4008d0a706a8c416d7958c4276b3a494f5190a41df6fc4d4e69b669edf9d5e2f97d4dda73091a3692659a526da060aead126b4c44c747b368bbfa1162c857d2d
6
+ metadata.gz: 6c3c4df40639c06928945db20c786d203e640196c4f475fac08e408b6d78d0558d1eb9efa21418d237222436db023ef46c5a33a34f87af19df69ba074af1b30e
7
+ data.tar.gz: e44b4b1cf379b0a04b4763e497ba3a1ee0fb953fad6aa74b765f45a789be242c279de47813715434d3a0336a5ccee11e9e0d35892bcd508519c9401c38fca0ef
@@ -5,8 +5,10 @@ module JetSet
5
5
  module Validations
6
6
  # The method runs all validations declared in the model
7
7
  def validate!
8
+ @to_skip ||= []
9
+
8
10
  validations = self.class.class_variable_defined?(:@@validations) ? self.class.class_variable_get(:@@validations) : {}
9
- attributes = validations.keys
11
+ attributes = validations.keys - @to_skip
10
12
  invalid_items = []
11
13
 
12
14
  attributes.each do |attribute|
@@ -26,6 +28,12 @@ module JetSet
26
28
  raise ValidationError.new("#{self.class.name} is invalid", invalid_items) if invalid_items.length > 0
27
29
  end
28
30
 
31
+ # Disables attribute validation for edge cases
32
+ def do_not_validate(attribute_name)
33
+ @to_skip ||= []
34
+ @to_skip << attribute_name
35
+ end
36
+
29
37
  def self.included(base)
30
38
  base.extend(ClassMethods)
31
39
  end
@@ -1,3 +1,3 @@
1
1
  module JetSet
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jet_set
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
  - Vladimir Kalinkin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-04 00:00:00.000000000 Z
11
+ date: 2020-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel