converters_before_validation 0.1.1 → 0.1.3

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
  SHA256:
3
- metadata.gz: 63341ad4fd640864f114a55de5f24fe4cf07f101f6f22c35186f4645c5f2576f
4
- data.tar.gz: fd7f1da7981b581c8a7d7f291ec30e065dc49b04549429a27f94de727f2c9dea
3
+ metadata.gz: a3f66896b57979bbccc1ce2016d76eaada25f044da4ef28bee14b7a87a52aca0
4
+ data.tar.gz: 2917bcd1c5f63ddf8779c8ea1f7141f55e26352e9e026025f05453877f9cc3ef
5
5
  SHA512:
6
- metadata.gz: 193c8a070e0b0ad3d0d30abc3260911b1269ae8f5d67d0fe181fb55396a5dcbc5ff3eee61d1727d889f2dfc3ac64ca6822540bfff38850e821bc10647bea778f
7
- data.tar.gz: a02b046458b30bdf00339b99d8bbdeff4e93a6f997749822f3c6c3922be10f14da38e815c2d509f3272ce9dc021115280fbc13712069055bd8f52a940a5a7655
6
+ metadata.gz: 3fb0f73276c86589eb6e140ce7a6895162924de224be086de61ac6aae35cfb50b5454a9aaea02b915df1329c664a2432c981e6b9f0b1f007bcbdfb32ca27fdc4
7
+ data.tar.gz: '0419d9b00824353857eb3ba46abc280872c53fcd8ee96e3540fdb7e6115edc9bba35f3da5ccc04d7eff44eb1dd7ada229e9511c8dd173bf05b963f26f7cb4997'
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ConvertersBeforeValidation
2
2
 
3
- string_converter_before_validation adds before_validation callback, which apply necessary function to attributes.
3
+ string_converter_before_validation adds before_validation callback, which applies necessary function to attributes.
4
4
 
5
5
  There are some derivatives:
6
6
 
@@ -10,7 +10,7 @@ There are some derivatives:
10
10
 
11
11
  ## Usage
12
12
 
13
- Let we have model Article with some fields: author_name, contact_email, title, camel_tag.
13
+ Let's suppose we have model Article with following fields: author_name, contact_email, title, camel_tag.
14
14
 
15
15
  ```ruby
16
16
  # app/models/article.rb
@@ -21,7 +21,7 @@ Let we have model Article with some fields: author_name, contact_email, title, c
21
21
  end
22
22
  ```
23
23
 
24
- Let's take fields' values from some not accurate input:
24
+ We're setting values for these fields sourced from some inaccurate input:
25
25
 
26
26
  ```
27
27
  >> article = Article.new(author_name: ' Boss ', contact_email: ' Boss@ExAmple.Org', title: ' hello ', camel_tag: 'hello_world')
@@ -43,13 +43,14 @@ Let's take fields' values from some not accurate input:
43
43
 
44
44
  ```
45
45
 
46
- So, we can want to format values before save it to our base:
46
+ We might want to sanitize our values before saving it to our database:
47
47
  contact_email = contact_email.squish.downcase
48
48
  author_name = author_name.squish
49
49
  title = title.squish.upcase
50
50
  camel_tag = camel_tag.camelcase
51
51
 
52
- This gem's functions are usefull for it. They add before_validation callbacks to model and do this job for us.
52
+ This gem's functions are presented for doing this:
53
+ before_validation callbacks added to its model and do the job.
53
54
 
54
55
  ```ruby
55
56
  # app/models/article.rb
@@ -1,6 +1,6 @@
1
1
  module ConvertersBeforeValidation
2
2
  ActiveSupport.on_load(:active_record) do
3
- # Adds private callback before_validation, which apply necessary function
3
+ # Adds private callback before_validation, which applies necessary function
4
4
  # to attributes.
5
5
  #
6
6
  # Usage:
@@ -1,3 +1,3 @@
1
1
  module ConvertersBeforeValidation
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: converters_before_validation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kanaikin Slava
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-20 00:00:00.000000000 Z
11
+ date: 2019-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -56,14 +56,14 @@ dependencies:
56
56
  requirements:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: 6.0.0.rc1
59
+ version: 6.0.0
60
60
  type: :development
61
61
  prerelease: false
62
62
  version_requirements: !ruby/object:Gem::Requirement
63
63
  requirements:
64
64
  - - "~>"
65
65
  - !ruby/object:Gem::Version
66
- version: 6.0.0.rc1
66
+ version: 6.0.0
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: sqlite3
69
69
  requirement: !ruby/object:Gem::Requirement
@@ -78,8 +78,8 @@ dependencies:
78
78
  - - ">="
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0'
81
- description: 'Adds before_validation callback, which apply necessary function to attributes.
82
- There are some derivatives: squish_before_validation_for, downcase_before_validation_for,
81
+ description: 'Adds before_validation callback, which applies necessary function to
82
+ attributes. There are some derivatives: squish_before_validation_for, downcase_before_validation_for,
83
83
  upcase_before_validation_for.'
84
84
  email:
85
85
  - sportix@gotar.ru