acts_as_downcasable_on 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 +4 -4
- data/README.md +15 -20
- data/lib/acts_as_downcasable_on/core.rb +1 -1
- data/lib/acts_as_downcasable_on/version.rb +1 -1
- metadata +2 -3
- data/CODE_OF_CONDUCT.md +0 -74
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 984c1d09fc6b58980fd1dc2d2d52d747f6af0ebd
|
4
|
+
data.tar.gz: aa788f345755bd18c05737acc23e62466972d9a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2acab39371d0b3ff1f6ece2e9afbedb4591aa62ab6890ef88f92844f40c3d246e37b95dc3798814916937efe104b0a0fcba293154902884c58b6bcce1bceba70
|
7
|
+
data.tar.gz: addcb5192f61a78688fefca8f9dc2724cf9f6cde2b6699b2e1b6c0e26ca676c8d75322af02dfcfd20a209d82c1a9b95b015fa3e604259476f198eeec6faa91a3
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
# ActsAsDowncasableOn
|
1
|
+
# ActsAsDowncasableOn
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Easy way to define AR attributes that should be stored in lowercase
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -19,25 +17,22 @@ And then execute:
|
|
19
17
|
Or install it yourself as:
|
20
18
|
|
21
19
|
$ gem install acts_as_downcasable_on
|
22
|
-
|
20
|
+
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
26
|
-
|
27
|
-
## Development
|
23
|
+
Setup
|
28
24
|
|
29
|
-
|
25
|
+
```ruby
|
26
|
+
class User < ActiveRecord::Base
|
27
|
+
acts_as_downcasable_on :email, :login
|
28
|
+
end
|
29
|
+
```
|
30
30
|
|
31
|
-
|
31
|
+
Attributes `email` and `login` will be forced to lowercase before model validation.
|
32
32
|
|
33
33
|
## Contributing
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
40
|
-
|
41
|
-
## Code of Conduct
|
42
|
-
|
43
|
-
Everyone interacting in the ActsAsDowncasableOn project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/acts_as_downcasable_on/blob/master/CODE_OF_CONDUCT.md).
|
34
|
+
1. Fork it
|
35
|
+
2. Create your feature branch (git checkout -b my-new-feature)
|
36
|
+
3. Commit your changes (git commit -am 'Add some feature')
|
37
|
+
4. Push to the branch (git push origin my-new-feature)
|
38
|
+
5. Create new Pull Request
|
@@ -3,7 +3,7 @@ module ActsAsDowncasableOn
|
|
3
3
|
def acts_as_downcasable_on(*attributes)
|
4
4
|
before_validation do
|
5
5
|
attributes.each do |attribute|
|
6
|
-
send(attribute).downcase! if send(attribute).present?
|
6
|
+
send(attribute).downcase! if send(attribute).present? && send(attribute).respond_to?(:downcase!)
|
7
7
|
end
|
8
8
|
end
|
9
9
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_downcasable_on
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vital Ryabchinskiy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -111,7 +111,6 @@ files:
|
|
111
111
|
- ".rspec"
|
112
112
|
- ".rubocop.yml"
|
113
113
|
- ".travis.yml"
|
114
|
-
- CODE_OF_CONDUCT.md
|
115
114
|
- Gemfile
|
116
115
|
- LICENSE.txt
|
117
116
|
- README.md
|
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
2
|
-
|
3
|
-
## Our Pledge
|
4
|
-
|
5
|
-
In the interest of fostering an open and welcoming environment, we as
|
6
|
-
contributors and maintainers pledge to making participation in our project and
|
7
|
-
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
-
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
-
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
-
orientation.
|
11
|
-
|
12
|
-
## Our Standards
|
13
|
-
|
14
|
-
Examples of behavior that contributes to creating a positive environment
|
15
|
-
include:
|
16
|
-
|
17
|
-
* Using welcoming and inclusive language
|
18
|
-
* Being respectful of differing viewpoints and experiences
|
19
|
-
* Gracefully accepting constructive criticism
|
20
|
-
* Focusing on what is best for the community
|
21
|
-
* Showing empathy towards other community members
|
22
|
-
|
23
|
-
Examples of unacceptable behavior by participants include:
|
24
|
-
|
25
|
-
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
-
advances
|
27
|
-
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
-
* Public or private harassment
|
29
|
-
* Publishing others' private information, such as a physical or electronic
|
30
|
-
address, without explicit permission
|
31
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
-
professional setting
|
33
|
-
|
34
|
-
## Our Responsibilities
|
35
|
-
|
36
|
-
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
-
behavior and are expected to take appropriate and fair corrective action in
|
38
|
-
response to any instances of unacceptable behavior.
|
39
|
-
|
40
|
-
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
-
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
-
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
-
threatening, offensive, or harmful.
|
45
|
-
|
46
|
-
## Scope
|
47
|
-
|
48
|
-
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
-
when an individual is representing the project or its community. Examples of
|
50
|
-
representing a project or community include using an official project e-mail
|
51
|
-
address, posting via an official social media account, or acting as an appointed
|
52
|
-
representative at an online or offline event. Representation of a project may be
|
53
|
-
further defined and clarified by project maintainers.
|
54
|
-
|
55
|
-
## Enforcement
|
56
|
-
|
57
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
-
reported by contacting the project team at vital.ryabchinskiy@gmail.com. All
|
59
|
-
complaints will be reviewed and investigated and will result in a response that
|
60
|
-
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
-
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
-
Further details of specific enforcement policies may be posted separately.
|
63
|
-
|
64
|
-
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
-
faith may face temporary or permanent repercussions as determined by other
|
66
|
-
members of the project's leadership.
|
67
|
-
|
68
|
-
## Attribution
|
69
|
-
|
70
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
-
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
-
|
73
|
-
[homepage]: http://contributor-covenant.org
|
74
|
-
[version]: http://contributor-covenant.org/version/1/4/
|