validate_specific_value 0.1.0 → 0.1.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
  SHA256:
3
- metadata.gz: e47b30e055e4a0c0590869046018f8df09741425593aee4f295a08fd77ed2ee5
4
- data.tar.gz: a97bfcc6759ea40d141773019a02f39515f63ff35890ef7476b7884f0b38767a
3
+ metadata.gz: 98510f8311522413c804ad1e231e8430a074315aabf3cd488f40a09da29dba20
4
+ data.tar.gz: a1d662dea74166631f59d6915c4ad54ac939fd969832bd7b5d2c3f9476441fd6
5
5
  SHA512:
6
- metadata.gz: 4dc26af30d118973ca56d9e8a2866c5aff480524b9adecf692b51497cc09aaf109ad3c55b258c847b906244b8e3248d39b0ea992b5080b150bcd1d8e91323ce1
7
- data.tar.gz: 04d9cb58b7591314bee8f4c03bfd96315e5a9d9ed20e90677a69eb67f4f3dc77b38fe336c0b22e490d13db508fffb7bc644f74bde2d5cf43e785a826398eb0b5
6
+ metadata.gz: 685f0bfbd8c1be750646abd8694cba7aa48084da9815932595a9dca9eb624547e3024edc0aa4ee448c4560426597cbcc77c66a25ab8f86b8fd0b0416a61339c8
7
+ data.tar.gz: '088f2138531f3f7fb7fdb505bb922d2d17694f165dcf93b4b1b6f7c73b6aa3f011cab36d0e32891963264e71c0c955f980843cb0ef0f70b81e34fa80515ed947'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- validate_specific_value (0.1.0)
4
+ validate_specific_value (0.1.1)
5
5
  activesupport
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,39 +1,59 @@
1
- # ValidateSpecificValue
1
+ # validate_specific_value
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/validate_specific_value`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ This is a way to validate single attribute in Rails. :tada:
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ - accessor methods
6
6
 
7
- ## Installation
7
+ ## Getting Started
8
8
 
9
- Add this line to your application's Gemfile:
9
+ Add this line to your applications Gemfile:
10
10
 
11
11
  ```ruby
12
12
  gem 'validate_specific_value'
13
13
  ```
14
14
 
15
- And then execute:
15
+ Add a validation rule to your model.
16
16
 
17
- $ bundle
17
+ ```ruby
18
+ validates :name, uniqueness: true
19
+ ```
18
20
 
19
- Or install it yourself as:
21
+ And use:
20
22
 
21
- $ gem install validate_specific_value
23
+ ```ruby
24
+ class User < ApplicationRecord
25
+ validates_specific :name
26
+ end
27
+ ```
22
28
 
23
- ## Usage
29
+ The first value will be the initial value. This gives you:
24
30
 
25
- TODO: Write usage instructions here
31
+ #### Accessor Methods
26
32
 
27
- ## Development
33
+ Instance context:
28
34
 
29
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
35
+ ```ruby
36
+ user = User.new(name: 'duplicate_name')
37
+ user.valid_name?
38
+ # => false
30
39
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
40
+ user.errors[:name]
41
+ # =>
32
42
 
33
- ## Contributing
43
+ ```
44
+
45
+ Class context:
46
+
47
+ ```ruby
48
+ User.valid_name?('duplicate_name')
49
+ # => false
50
+ ```
34
51
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/validate_specific_value.
52
+ ## Contributing
36
53
 
37
- ## License
54
+ Everyone is encouraged to help improve this project. Here are a few ways you can help:
38
55
 
39
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
56
+ - [Report bugs](https://github.com/ts-3156/validate_specific_value/issues)
57
+ - Fix bugs and [submit pull requests](https://github.com/ts-3156/validate_specific_value/pulls)
58
+ - Write, clarify, or fix documentation
59
+ - Suggest or add new features
@@ -1,3 +1,3 @@
1
1
  module ValidateSpecificValue
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validate_specific_value
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ts-3156