devise-multi_email_revived 3.0.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 +7 -0
- data/.gitignore +15 -0
- data/.rspec +2 -0
- data/.travis.yml +16 -0
- data/CHANGELOG.md +38 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +199 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/devise-multi-email.code-workspace +8 -0
- data/devise-multi_email.gemspec +31 -0
- data/examples/rails5_app/.gitignore +21 -0
- data/examples/rails5_app/Gemfile +55 -0
- data/examples/rails5_app/Gemfile.lock +189 -0
- data/examples/rails5_app/README.md +24 -0
- data/examples/rails5_app/Rakefile +6 -0
- data/examples/rails5_app/app/assets/config/manifest.js +3 -0
- data/examples/rails5_app/app/assets/images/.keep +0 -0
- data/examples/rails5_app/app/assets/javascripts/application.js +16 -0
- data/examples/rails5_app/app/assets/javascripts/cable.js +13 -0
- data/examples/rails5_app/app/assets/javascripts/channels/.keep +0 -0
- data/examples/rails5_app/app/assets/stylesheets/application.css +15 -0
- data/examples/rails5_app/app/channels/application_cable/channel.rb +4 -0
- data/examples/rails5_app/app/channels/application_cable/connection.rb +4 -0
- data/examples/rails5_app/app/controllers/application_controller.rb +3 -0
- data/examples/rails5_app/app/controllers/concerns/.keep +0 -0
- data/examples/rails5_app/app/helpers/application_helper.rb +2 -0
- data/examples/rails5_app/app/jobs/application_job.rb +2 -0
- data/examples/rails5_app/app/mailers/application_mailer.rb +4 -0
- data/examples/rails5_app/app/models/application_record.rb +3 -0
- data/examples/rails5_app/app/models/concerns/.keep +0 -0
- data/examples/rails5_app/app/models/email.rb +5 -0
- data/examples/rails5_app/app/models/user.rb +9 -0
- data/examples/rails5_app/app/views/layouts/application.html.erb +14 -0
- data/examples/rails5_app/app/views/layouts/mailer.html.erb +13 -0
- data/examples/rails5_app/app/views/layouts/mailer.text.erb +1 -0
- data/examples/rails5_app/bin/bundle +3 -0
- data/examples/rails5_app/bin/rails +4 -0
- data/examples/rails5_app/bin/rake +4 -0
- data/examples/rails5_app/bin/setup +34 -0
- data/examples/rails5_app/bin/update +29 -0
- data/examples/rails5_app/config/application.rb +15 -0
- data/examples/rails5_app/config/boot.rb +3 -0
- data/examples/rails5_app/config/cable.yml +9 -0
- data/examples/rails5_app/config/database.yml +25 -0
- data/examples/rails5_app/config/environment.rb +5 -0
- data/examples/rails5_app/config/environments/development.rb +56 -0
- data/examples/rails5_app/config/environments/production.rb +86 -0
- data/examples/rails5_app/config/environments/test.rb +42 -0
- data/examples/rails5_app/config/initializers/application_controller_renderer.rb +6 -0
- data/examples/rails5_app/config/initializers/assets.rb +11 -0
- data/examples/rails5_app/config/initializers/backtrace_silencers.rb +7 -0
- data/examples/rails5_app/config/initializers/cookies_serializer.rb +5 -0
- data/examples/rails5_app/config/initializers/devise.rb +274 -0
- data/examples/rails5_app/config/initializers/filter_parameter_logging.rb +4 -0
- data/examples/rails5_app/config/initializers/inflections.rb +16 -0
- data/examples/rails5_app/config/initializers/mime_types.rb +4 -0
- data/examples/rails5_app/config/initializers/new_framework_defaults.rb +24 -0
- data/examples/rails5_app/config/initializers/session_store.rb +3 -0
- data/examples/rails5_app/config/initializers/wrap_parameters.rb +14 -0
- data/examples/rails5_app/config/locales/devise.en.yml +62 -0
- data/examples/rails5_app/config/locales/en.yml +23 -0
- data/examples/rails5_app/config/puma.rb +47 -0
- data/examples/rails5_app/config/routes.rb +4 -0
- data/examples/rails5_app/config/secrets.yml +22 -0
- data/examples/rails5_app/config/spring.rb +6 -0
- data/examples/rails5_app/config.ru +5 -0
- data/examples/rails5_app/db/migrate/20170307140813_devise_create_users.rb +49 -0
- data/examples/rails5_app/db/migrate/20170307145547_add_password_salt_to_users.rb +5 -0
- data/examples/rails5_app/db/schema.rb +44 -0
- data/examples/rails5_app/db/seeds.rb +7 -0
- data/examples/rails5_app/lib/assets/.keep +0 -0
- data/examples/rails5_app/lib/tasks/.keep +0 -0
- data/examples/rails5_app/log/.keep +0 -0
- data/examples/rails5_app/public/404.html +67 -0
- data/examples/rails5_app/public/422.html +67 -0
- data/examples/rails5_app/public/500.html +66 -0
- data/examples/rails5_app/public/apple-touch-icon-precomposed.png +0 -0
- data/examples/rails5_app/public/apple-touch-icon.png +0 -0
- data/examples/rails5_app/public/favicon.ico +0 -0
- data/examples/rails5_app/public/robots.txt +5 -0
- data/examples/rails5_app/test/controllers/.keep +0 -0
- data/examples/rails5_app/test/fixtures/.keep +0 -0
- data/examples/rails5_app/test/fixtures/files/.keep +0 -0
- data/examples/rails5_app/test/helpers/.keep +0 -0
- data/examples/rails5_app/test/integration/.keep +0 -0
- data/examples/rails5_app/test/mailers/.keep +0 -0
- data/examples/rails5_app/test/models/.keep +0 -0
- data/examples/rails5_app/test/test_helper.rb +10 -0
- data/examples/rails5_app/tmp/.keep +0 -0
- data/examples/rails5_app/vendor/assets/javascripts/.keep +0 -0
- data/examples/rails5_app/vendor/assets/stylesheets/.keep +0 -0
- data/gemfiles/rails_5_1.gemfile +5 -0
- data/gemfiles/rails_5_2.gemfile +5 -0
- data/gemfiles/rails_6_0.gemfile +5 -0
- data/lib/devise/multi-email/association_manager.rb +43 -0
- data/lib/devise/multi-email/email_model_extensions.rb +20 -0
- data/lib/devise/multi-email/email_model_manager.rb +16 -0
- data/lib/devise/multi-email/models/authenticatable.rb +96 -0
- data/lib/devise/multi-email/models/confirmable.rb +108 -0
- data/lib/devise/multi-email/models/validatable.rb +107 -0
- data/lib/devise/multi-email/parent_model_extensions.rb +28 -0
- data/lib/devise/multi-email/parent_model_manager.rb +90 -0
- data/lib/devise/multi-email/version.rb +5 -0
- data/lib/devise/multi_email/association_manager.rb +43 -0
- data/lib/devise/multi_email/email_model_extensions.rb +20 -0
- data/lib/devise/multi_email/email_model_manager.rb +16 -0
- data/lib/devise/multi_email/models/authenticatable.rb +96 -0
- data/lib/devise/multi_email/models/confirmable.rb +108 -0
- data/lib/devise/multi_email/models/validatable.rb +107 -0
- data/lib/devise/multi_email/parent_model_extensions.rb +28 -0
- data/lib/devise/multi_email/parent_model_manager.rb +90 -0
- data/lib/devise/multi_email/version.rb +5 -0
- data/lib/devise/multi_email.rb +60 -0
- data/mise.toml +2 -0
- metadata +262 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 402fd892817c3626f7b3f268e03679d351df97a6065e3e3127e4039d4ab2646b
|
|
4
|
+
data.tar.gz: 40e1335998c714c0d5c58bf53a9e461d31e20e2ad28885ff8ed0dd70209c0e75
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: ed8e2caa967c1acfe62c6a66f33a9d823fb19696756a3bea18d228879f18ca408f5b9d033b20c6994d1ecb47531e95129606ab86e9aa9bd16326b53d65cf408c
|
|
7
|
+
data.tar.gz: 9a0b47607a443d4c842384f9ee7aa3bd8a46762514e549b3e224fc92ac9691c6e3b3ef2988c8e31c052a935c630f5f3109397f0cf7bdd01c6f36a56a56fe19eb
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
### Unreleased
|
|
2
|
+
* Fix ActiveModel::Errors#keys deprecation in Rails 6.1
|
|
3
|
+
|
|
4
|
+
### 3.0.0 - 2019-11-06
|
|
5
|
+
* Deprecate the support of Rails 4 (although it might still work)
|
|
6
|
+
* Fix warnings in Rails 6
|
|
7
|
+
|
|
8
|
+
### 2.0.1 - 2017-05-16
|
|
9
|
+
|
|
10
|
+
* Refactored to simplify some logic and start moving toward mimicking default Devise lifecycle behavior
|
|
11
|
+
* Added `Devise::MultiEmail.only_login_with_primary_email` option to restrict login to only primary emails
|
|
12
|
+
* Added `Devise::MultiEmail.autosave_emails` option to automatically enable `autosave` on "emails" association
|
|
13
|
+
|
|
14
|
+
### 2.0.0 - 2017-05-12
|
|
15
|
+
|
|
16
|
+
* New `Devise::MultiEmail#configure` setup with options for `user` and `emails` associations and `primary_email_record` method names
|
|
17
|
+
* Refactor to expose `_multi_email_*` prefixed methods on models
|
|
18
|
+
* Changed logic when changing an email address to look up existing email record, otherwise creating a new one, then marking it "primary"
|
|
19
|
+
* Changed logic when changing an email address to mark all others as `primary = false`
|
|
20
|
+
* Changed logic when changing an email address to `nil` to mark as `primary = false` rather than deleting records
|
|
21
|
+
|
|
22
|
+
Many thanks to [joelvh](https://github.com/joelvh) for the great work!
|
|
23
|
+
|
|
24
|
+
### 1.0.5 - 2016-12-29
|
|
25
|
+
|
|
26
|
+
* New `.find_by_email` method. Thanks to [mrjlynch](https://github.com/mrjlynch).
|
|
27
|
+
|
|
28
|
+
### 1.0.4 - 2016-08-13
|
|
29
|
+
|
|
30
|
+
* Bug fix: Case-insentive configuration of email is ignored (#1). Thanks to [@fonglh](https://github.com/fonglh).
|
|
31
|
+
|
|
32
|
+
### 1.0.3 - 2016-02-18
|
|
33
|
+
|
|
34
|
+
* Bug fix: Fix a wrong error message which shows "Email can't be blank" when email does not exist.
|
|
35
|
+
|
|
36
|
+
### 1.0.2 - 2016-01-12
|
|
37
|
+
|
|
38
|
+
First stable release.
|
data/CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Contributor Code of Conduct
|
|
2
|
+
|
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
|
4
|
+
|
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
|
6
|
+
|
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
|
8
|
+
|
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
|
10
|
+
|
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
|
12
|
+
|
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015 WANG QIANG
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Devise::MultiEmail [](https://travis-ci.org/allenwq/devise-multi_email) [](https://coveralls.io/github/allenwq/devise-multi_email?branch=master)
|
|
2
|
+
|
|
3
|
+
Letting [Devise](https://github.com/plataformatec/devise) support multiple emails, allows you to:
|
|
4
|
+
- Login with multiple emails
|
|
5
|
+
- Send confirmations to multiple emails
|
|
6
|
+
- Recover the password with any of the emails
|
|
7
|
+
- Validations for multiple emails
|
|
8
|
+
|
|
9
|
+
`:multi_email_authenticatable`, `:multi_email_confirmable` and `:multi_email_validatable` are provided by _devise-multi-email_.
|
|
10
|
+
|
|
11
|
+
## Getting Started
|
|
12
|
+
|
|
13
|
+
Add this line to your application's `Gemfile`:
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
gem 'devise-multi_email_revived'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Note: if you've been using this gem for a while, it is now being
|
|
20
|
+
published to [RubyGems](https://www.rubygems.org) under a new package
|
|
21
|
+
name due to maintenance continuity issues. Please update your `Gemfile`
|
|
22
|
+
accordingly.
|
|
23
|
+
|
|
24
|
+
Suppose you have already setup Devise, your `User` model might look like this:
|
|
25
|
+
|
|
26
|
+
```ruby
|
|
27
|
+
class User < ActiveRecord::Base
|
|
28
|
+
devise :database_authenticatable, :registerable
|
|
29
|
+
end
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
In order to let your `User` support multiple emails, with _devise-multi-email_ what you need to do is just:
|
|
33
|
+
|
|
34
|
+
```ruby
|
|
35
|
+
class User < ActiveRecord::Base
|
|
36
|
+
has_many :emails
|
|
37
|
+
|
|
38
|
+
# Replace :database_authenticatable, with :multi_email_authenticatable
|
|
39
|
+
devise :multi_email_authenticatable, :registerable
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
class Email < ActiveRecord::Base
|
|
43
|
+
belongs_to :user
|
|
44
|
+
end
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Note that the `:email` column should be moved from `users` table to the `emails` table, and a new `primary` boolean column should be added to the `emails` table (so that all the emails will be sent to the primary email, and `user.email` will give you the primary email address). Your `emails` table's migration should look like:
|
|
48
|
+
|
|
49
|
+
```ruby
|
|
50
|
+
create_table :emails do |t|
|
|
51
|
+
t.integer :user_id
|
|
52
|
+
t.string :email
|
|
53
|
+
t.boolean :primary
|
|
54
|
+
end
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
You can choose whether or not users can login with an email address that is not the primary email address.
|
|
58
|
+
|
|
59
|
+
```ruby
|
|
60
|
+
Devise::MultiEmail.configure do |config|
|
|
61
|
+
# Default is `false`
|
|
62
|
+
config.only_login_with_primary_email = true
|
|
63
|
+
end
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The `autosave` is automatically enabled on the `emails` association by default. This is to ensure the `primary`
|
|
67
|
+
flag is persisted for all emails when the primary email is changed. When `autosave` is not enabled on the association,
|
|
68
|
+
only new emails are saved when the parent (e.g. `User`) record is saved. (Updates to already-persisted email records
|
|
69
|
+
are not saved.)
|
|
70
|
+
|
|
71
|
+
If you don't want `autosave` to be enabled automatically, you can disable this feature. What this will do is
|
|
72
|
+
enable alternative behavior, which adds an `after_save` callback to the parent record and calls `email.save` on each email
|
|
73
|
+
record where the `primary` value has changed.
|
|
74
|
+
|
|
75
|
+
```ruby
|
|
76
|
+
Devise::MultiEmail.configure do |config|
|
|
77
|
+
# Default is `true`
|
|
78
|
+
config.autosave_emails = false
|
|
79
|
+
end
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Configure custom association names
|
|
83
|
+
|
|
84
|
+
You may not want to use the association `user.emails` or `email.users`. You can customize the name of the associations used. Add your custom configurations to an initializer file such as `config/initializers/devise-multi_email.rb`.
|
|
85
|
+
|
|
86
|
+
_Note: model classes are inferred from the associations._
|
|
87
|
+
|
|
88
|
+
```ruby
|
|
89
|
+
Devise::MultiEmail.configure do |config|
|
|
90
|
+
# Default is :user for Email model
|
|
91
|
+
config.parent_association_name = :team
|
|
92
|
+
# Default is :emails for parent (e.g. User) model
|
|
93
|
+
config.emails_association_name = :email_addresses
|
|
94
|
+
# Default is :primary_email_record
|
|
95
|
+
config.primary_email_method_name = :primary_email
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Example use of custom association names
|
|
99
|
+
team = Team.first
|
|
100
|
+
emails = team.email_addresses
|
|
101
|
+
|
|
102
|
+
email = EmailAddress.first
|
|
103
|
+
team = email.team
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Confirmable with multiple emails
|
|
107
|
+
|
|
108
|
+
Sending separate confirmations to each email is supported. What you need to do is:
|
|
109
|
+
|
|
110
|
+
Declare `devise :multi_email_confirmable` in your `User` model:
|
|
111
|
+
|
|
112
|
+
```ruby
|
|
113
|
+
class User < ActiveRecord::Base
|
|
114
|
+
has_many :emails
|
|
115
|
+
|
|
116
|
+
# You should not declare :confirmable and :multi_email_confirmable at the same time.
|
|
117
|
+
devise :multi_email_authenticatable, :registerable, :multi_email_confirmable
|
|
118
|
+
end
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Add `:confirmation_token`, `:confirmed_at` and `:confirmation_sent_at` to your `emails` table:
|
|
122
|
+
|
|
123
|
+
```ruby
|
|
124
|
+
create_table :emails do |t|
|
|
125
|
+
t.integer :user_id
|
|
126
|
+
t.string :email
|
|
127
|
+
t.boolean :primary, default: false
|
|
128
|
+
|
|
129
|
+
## Confirmable
|
|
130
|
+
t.string :unconfirmed_email
|
|
131
|
+
t.string :confirmation_token
|
|
132
|
+
t.datetime :confirmed_at
|
|
133
|
+
t.datetime :confirmation_sent_at
|
|
134
|
+
end
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Then all the methods in Devise confirmable are available in your `Email` model. You can do `email#send_confirmation_instructions` for each of your email. And `user#send_confirmation_instructions` will be delegated to the primary email.
|
|
138
|
+
|
|
139
|
+
## Validatable with multiple emails
|
|
140
|
+
|
|
141
|
+
Declare `devise :multi_email_validatable` in the `User` model, then all the user emails will be validated:
|
|
142
|
+
|
|
143
|
+
```ruby
|
|
144
|
+
class User < ActiveRecord::Base
|
|
145
|
+
has_many :emails
|
|
146
|
+
|
|
147
|
+
# You should not declare :validatable and :multi_email_validatable at the same time.
|
|
148
|
+
devise :multi_email_authenticatable, :registerable, :multi_email_validatable
|
|
149
|
+
end
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
You can find the detailed configurations in the [rails 5 example app](https://github.com/allenwq/devise-multi_email/tree/master/examples/rails5_app).
|
|
153
|
+
|
|
154
|
+
## ActiveJob Integration
|
|
155
|
+
|
|
156
|
+
The [Devise README](https://github.com/plataformatec/devise#activejob-integration) describes how to use ActiveJob to deliver emails in the background. Normally you would place the following code in your `User` model, however when using _devise-multi_email_ you should place this in the `Email` model.
|
|
157
|
+
|
|
158
|
+
```ruby
|
|
159
|
+
# models/email.rb
|
|
160
|
+
def send_devise_notification(notification, *args)
|
|
161
|
+
devise_mailer.send(notification, self, *args).deliver_later
|
|
162
|
+
end
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## What's more
|
|
166
|
+
|
|
167
|
+
The gem works with all other Devise modules as expected -- you don't need to add the "multi_email" prefix.
|
|
168
|
+
|
|
169
|
+
```ruby
|
|
170
|
+
class User < ActiveRecord::Base
|
|
171
|
+
devise :multi_email_authenticatable, :multi_email_confirmable, :multi_email_validatable, :lockable,
|
|
172
|
+
:recoverable, :registerable, :rememberable, :timeoutable, :trackable
|
|
173
|
+
end
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Issues
|
|
177
|
+
|
|
178
|
+
You need to implement add/delete emails for a user as well as set/unset "primary" for each email.
|
|
179
|
+
|
|
180
|
+
You can do `email.send_confirmation_instructions` for each email individually, but you need to handle that logic in some place (except for the primary email, which is handled by Devise by default). e.g. After a new email was added by a user, you might want to provide some buttons in the view to allow users to resend confirmation instructions for that email.
|
|
181
|
+
|
|
182
|
+
## Wiki
|
|
183
|
+
|
|
184
|
+
[Migrating existing user records](https://github.com/allenwq/devise-multi_email/wiki/Migrating-existing-user-records)
|
|
185
|
+
|
|
186
|
+
## Development
|
|
187
|
+
|
|
188
|
+
After checking out the repo, run `bundle install` to install dependencies.
|
|
189
|
+
|
|
190
|
+
Then, run `bundle exec rake` to run the RSpec test suite.
|
|
191
|
+
|
|
192
|
+
## Contributing
|
|
193
|
+
|
|
194
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/allenwq/devise-multi_email. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
## License
|
|
198
|
+
|
|
199
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "devise/multi_email"
|
|
5
|
+
|
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
|
8
|
+
|
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
+
# require "pry"
|
|
11
|
+
# Pry.start
|
|
12
|
+
|
|
13
|
+
require "irb"
|
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
|
+
require 'devise/multi-email/version'
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = 'devise-multi_email_revived'
|
|
7
|
+
spec.version = Devise::MultiEmail::VERSION
|
|
8
|
+
spec.authors = ['ALLEN WANG QIANG', 'Joel Van Horn', 'Micah Gideon Modell']
|
|
9
|
+
spec.email = ['rovingbreeze@gmail.com', 'joel@joelvanhorn.com', 'micah.modell@gmail.com']
|
|
10
|
+
|
|
11
|
+
spec.summary = 'Let devise support multiple emails.'
|
|
12
|
+
spec.description = 'Devise authenticatable, confirmable and validatable with multiple emails.'
|
|
13
|
+
spec.homepage = 'https://github.com/allenwq/devise-multi_email.git'
|
|
14
|
+
spec.license = 'MIT'
|
|
15
|
+
|
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
17
|
+
spec.bindir = 'exe'
|
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
19
|
+
spec.require_paths = ['lib']
|
|
20
|
+
|
|
21
|
+
spec.required_ruby_version = '>= 3.0', '<5.0'
|
|
22
|
+
|
|
23
|
+
spec.add_runtime_dependency 'devise', '<6.0'
|
|
24
|
+
|
|
25
|
+
spec.add_development_dependency 'bundler', '<5.0'
|
|
26
|
+
spec.add_development_dependency 'capybara', '<4.0'
|
|
27
|
+
spec.add_development_dependency 'coveralls', '<=0.8.23'
|
|
28
|
+
spec.add_development_dependency 'rake', '<14.0'
|
|
29
|
+
spec.add_development_dependency 'rspec', '<4.0'
|
|
30
|
+
spec.add_development_dependency 'sqlite3', '<=2.9.0'
|
|
31
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
|
|
2
|
+
#
|
|
3
|
+
# If you find yourself ignoring temporary files generated by your text editor
|
|
4
|
+
# or operating system, you probably want to add a global ignore instead:
|
|
5
|
+
# git config --global core.excludesfile '~/.gitignore_global'
|
|
6
|
+
|
|
7
|
+
# Ignore bundler config.
|
|
8
|
+
/.bundle
|
|
9
|
+
|
|
10
|
+
# Ignore the default SQLite database.
|
|
11
|
+
/db/*.sqlite3
|
|
12
|
+
/db/*.sqlite3-journal
|
|
13
|
+
|
|
14
|
+
# Ignore all logfiles and tempfiles.
|
|
15
|
+
/log/*
|
|
16
|
+
/tmp/*
|
|
17
|
+
!/log/.keep
|
|
18
|
+
!/tmp/.keep
|
|
19
|
+
|
|
20
|
+
# Ignore Byebug command history file.
|
|
21
|
+
.byebug_history
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
git_source(:github) do |repo_name|
|
|
4
|
+
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
|
|
5
|
+
"https://github.com/#{repo_name}.git"
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
|
10
|
+
gem 'rails', '~> 5.0.2'
|
|
11
|
+
# Use sqlite3 as the database for Active Record
|
|
12
|
+
gem 'sqlite3'
|
|
13
|
+
# Use Puma as the app server
|
|
14
|
+
gem 'puma', '~> 3.0'
|
|
15
|
+
# Use SCSS for stylesheets
|
|
16
|
+
gem 'sass-rails', '~> 5.0'
|
|
17
|
+
# Use Uglifier as compressor for JavaScript assets
|
|
18
|
+
gem 'uglifier', '>= 1.3.0'
|
|
19
|
+
# See https://github.com/rails/execjs#readme for more supported runtimes
|
|
20
|
+
# gem 'therubyracer', platforms: :ruby
|
|
21
|
+
|
|
22
|
+
# Use jquery as the JavaScript library
|
|
23
|
+
gem 'jquery-rails'
|
|
24
|
+
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
|
|
25
|
+
gem 'turbolinks', '~> 5'
|
|
26
|
+
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
|
|
27
|
+
gem 'jbuilder', '~> 2.5'
|
|
28
|
+
# Use Redis adapter to run Action Cable in production
|
|
29
|
+
# gem 'redis', '~> 3.0'
|
|
30
|
+
# Use ActiveModel has_secure_password
|
|
31
|
+
# gem 'bcrypt', '~> 3.1.7'
|
|
32
|
+
|
|
33
|
+
# Use Capistrano for deployment
|
|
34
|
+
# gem 'capistrano-rails', group: :development
|
|
35
|
+
|
|
36
|
+
group :development, :test do
|
|
37
|
+
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
|
38
|
+
gem 'byebug', platform: :mri
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
group :development do
|
|
42
|
+
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
|
|
43
|
+
gem 'web-console', '>= 3.3.0'
|
|
44
|
+
gem 'listen', '~> 3.0.5'
|
|
45
|
+
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
|
|
46
|
+
gem 'spring'
|
|
47
|
+
gem 'spring-watcher-listen', '~> 2.0.0'
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
|
51
|
+
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
|
52
|
+
|
|
53
|
+
gem 'devise'
|
|
54
|
+
gem 'devise-multi_email'
|
|
55
|
+
gem 'devise-encryptable'
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
GEM
|
|
2
|
+
remote: https://rubygems.org/
|
|
3
|
+
specs:
|
|
4
|
+
actioncable (5.0.2)
|
|
5
|
+
actionpack (= 5.0.2)
|
|
6
|
+
nio4r (>= 1.2, < 3.0)
|
|
7
|
+
websocket-driver (~> 0.6.1)
|
|
8
|
+
actionmailer (5.0.2)
|
|
9
|
+
actionpack (= 5.0.2)
|
|
10
|
+
actionview (= 5.0.2)
|
|
11
|
+
activejob (= 5.0.2)
|
|
12
|
+
mail (~> 2.5, >= 2.5.4)
|
|
13
|
+
rails-dom-testing (~> 2.0)
|
|
14
|
+
actionpack (5.0.2)
|
|
15
|
+
actionview (= 5.0.2)
|
|
16
|
+
activesupport (= 5.0.2)
|
|
17
|
+
rack (~> 2.0)
|
|
18
|
+
rack-test (~> 0.6.3)
|
|
19
|
+
rails-dom-testing (~> 2.0)
|
|
20
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
|
21
|
+
actionview (5.0.2)
|
|
22
|
+
activesupport (= 5.0.2)
|
|
23
|
+
builder (~> 3.1)
|
|
24
|
+
erubis (~> 2.7.0)
|
|
25
|
+
rails-dom-testing (~> 2.0)
|
|
26
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
|
27
|
+
activejob (5.0.2)
|
|
28
|
+
activesupport (= 5.0.2)
|
|
29
|
+
globalid (>= 0.3.6)
|
|
30
|
+
activemodel (5.0.2)
|
|
31
|
+
activesupport (= 5.0.2)
|
|
32
|
+
activerecord (5.0.2)
|
|
33
|
+
activemodel (= 5.0.2)
|
|
34
|
+
activesupport (= 5.0.2)
|
|
35
|
+
arel (~> 7.0)
|
|
36
|
+
activesupport (5.0.2)
|
|
37
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
38
|
+
i18n (~> 0.7)
|
|
39
|
+
minitest (~> 5.1)
|
|
40
|
+
tzinfo (~> 1.1)
|
|
41
|
+
arel (7.1.4)
|
|
42
|
+
bcrypt (3.1.13)
|
|
43
|
+
builder (3.2.3)
|
|
44
|
+
byebug (9.0.6)
|
|
45
|
+
concurrent-ruby (1.1.5)
|
|
46
|
+
crass (1.0.5)
|
|
47
|
+
debug_inspector (0.0.2)
|
|
48
|
+
devise (4.7.1)
|
|
49
|
+
bcrypt (~> 3.0)
|
|
50
|
+
orm_adapter (~> 0.1)
|
|
51
|
+
railties (>= 4.1.0)
|
|
52
|
+
responders
|
|
53
|
+
warden (~> 1.2.3)
|
|
54
|
+
devise-encryptable (0.2.0)
|
|
55
|
+
devise (>= 2.1.0)
|
|
56
|
+
devise-multi_email (1.0.5)
|
|
57
|
+
devise
|
|
58
|
+
erubis (2.7.0)
|
|
59
|
+
execjs (2.7.0)
|
|
60
|
+
ffi (1.11.1)
|
|
61
|
+
globalid (0.3.7)
|
|
62
|
+
activesupport (>= 4.1.0)
|
|
63
|
+
i18n (0.9.5)
|
|
64
|
+
concurrent-ruby (~> 1.0)
|
|
65
|
+
jbuilder (2.6.3)
|
|
66
|
+
activesupport (>= 3.0.0, < 5.2)
|
|
67
|
+
multi_json (~> 1.2)
|
|
68
|
+
jquery-rails (4.2.2)
|
|
69
|
+
rails-dom-testing (>= 1, < 3)
|
|
70
|
+
railties (>= 4.2.0)
|
|
71
|
+
thor (>= 0.14, < 2.0)
|
|
72
|
+
listen (3.0.8)
|
|
73
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
|
74
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
|
75
|
+
loofah (2.3.1)
|
|
76
|
+
crass (~> 1.0.2)
|
|
77
|
+
nokogiri (>= 1.5.9)
|
|
78
|
+
mail (2.6.4)
|
|
79
|
+
mime-types (>= 1.16, < 4)
|
|
80
|
+
method_source (0.9.2)
|
|
81
|
+
mime-types (3.1)
|
|
82
|
+
mime-types-data (~> 3.2015)
|
|
83
|
+
mime-types-data (3.2016.0521)
|
|
84
|
+
mini_portile2 (2.4.0)
|
|
85
|
+
minitest (5.12.2)
|
|
86
|
+
multi_json (1.12.1)
|
|
87
|
+
nio4r (2.0.0)
|
|
88
|
+
nokogiri (1.10.5)
|
|
89
|
+
mini_portile2 (~> 2.4.0)
|
|
90
|
+
orm_adapter (0.5.0)
|
|
91
|
+
puma (3.7.1)
|
|
92
|
+
rack (2.0.7)
|
|
93
|
+
rack-test (0.6.3)
|
|
94
|
+
rack (>= 1.0)
|
|
95
|
+
rails (5.0.2)
|
|
96
|
+
actioncable (= 5.0.2)
|
|
97
|
+
actionmailer (= 5.0.2)
|
|
98
|
+
actionpack (= 5.0.2)
|
|
99
|
+
actionview (= 5.0.2)
|
|
100
|
+
activejob (= 5.0.2)
|
|
101
|
+
activemodel (= 5.0.2)
|
|
102
|
+
activerecord (= 5.0.2)
|
|
103
|
+
activesupport (= 5.0.2)
|
|
104
|
+
bundler (>= 1.3.0, < 2.0)
|
|
105
|
+
railties (= 5.0.2)
|
|
106
|
+
sprockets-rails (>= 2.0.0)
|
|
107
|
+
rails-dom-testing (2.0.3)
|
|
108
|
+
activesupport (>= 4.2.0)
|
|
109
|
+
nokogiri (>= 1.6)
|
|
110
|
+
rails-html-sanitizer (1.3.0)
|
|
111
|
+
loofah (~> 2.3)
|
|
112
|
+
railties (5.0.2)
|
|
113
|
+
actionpack (= 5.0.2)
|
|
114
|
+
activesupport (= 5.0.2)
|
|
115
|
+
method_source
|
|
116
|
+
rake (>= 0.8.7)
|
|
117
|
+
thor (>= 0.18.1, < 2.0)
|
|
118
|
+
rake (13.0.0)
|
|
119
|
+
rb-fsevent (0.9.8)
|
|
120
|
+
rb-inotify (0.9.8)
|
|
121
|
+
ffi (>= 0.5.0)
|
|
122
|
+
responders (3.0.0)
|
|
123
|
+
actionpack (>= 5.0)
|
|
124
|
+
railties (>= 5.0)
|
|
125
|
+
sass (3.4.23)
|
|
126
|
+
sass-rails (5.0.6)
|
|
127
|
+
railties (>= 4.0.0, < 6)
|
|
128
|
+
sass (~> 3.1)
|
|
129
|
+
sprockets (>= 2.8, < 4.0)
|
|
130
|
+
sprockets-rails (>= 2.0, < 4.0)
|
|
131
|
+
tilt (>= 1.1, < 3)
|
|
132
|
+
spring (2.0.1)
|
|
133
|
+
activesupport (>= 4.2)
|
|
134
|
+
spring-watcher-listen (2.0.1)
|
|
135
|
+
listen (>= 2.7, < 4.0)
|
|
136
|
+
spring (>= 1.2, < 3.0)
|
|
137
|
+
sprockets (3.7.2)
|
|
138
|
+
concurrent-ruby (~> 1.0)
|
|
139
|
+
rack (> 1, < 3)
|
|
140
|
+
sprockets-rails (3.2.0)
|
|
141
|
+
actionpack (>= 4.0)
|
|
142
|
+
activesupport (>= 4.0)
|
|
143
|
+
sprockets (>= 3.0.0)
|
|
144
|
+
sqlite3 (1.3.13)
|
|
145
|
+
thor (0.20.3)
|
|
146
|
+
thread_safe (0.3.6)
|
|
147
|
+
tilt (2.0.6)
|
|
148
|
+
turbolinks (5.0.1)
|
|
149
|
+
turbolinks-source (~> 5)
|
|
150
|
+
turbolinks-source (5.0.0)
|
|
151
|
+
tzinfo (1.2.5)
|
|
152
|
+
thread_safe (~> 0.1)
|
|
153
|
+
uglifier (3.1.4)
|
|
154
|
+
execjs (>= 0.3.0, < 3)
|
|
155
|
+
warden (1.2.8)
|
|
156
|
+
rack (>= 2.0.6)
|
|
157
|
+
web-console (3.4.0)
|
|
158
|
+
actionview (>= 5.0)
|
|
159
|
+
activemodel (>= 5.0)
|
|
160
|
+
debug_inspector
|
|
161
|
+
railties (>= 5.0)
|
|
162
|
+
websocket-driver (0.6.5)
|
|
163
|
+
websocket-extensions (>= 0.1.0)
|
|
164
|
+
websocket-extensions (0.1.2)
|
|
165
|
+
|
|
166
|
+
PLATFORMS
|
|
167
|
+
ruby
|
|
168
|
+
|
|
169
|
+
DEPENDENCIES
|
|
170
|
+
byebug
|
|
171
|
+
devise
|
|
172
|
+
devise-encryptable
|
|
173
|
+
devise-multi_email
|
|
174
|
+
jbuilder (~> 2.5)
|
|
175
|
+
jquery-rails
|
|
176
|
+
listen (~> 3.0.5)
|
|
177
|
+
puma (~> 3.0)
|
|
178
|
+
rails (~> 5.0.2)
|
|
179
|
+
sass-rails (~> 5.0)
|
|
180
|
+
spring
|
|
181
|
+
spring-watcher-listen (~> 2.0.0)
|
|
182
|
+
sqlite3
|
|
183
|
+
turbolinks (~> 5)
|
|
184
|
+
tzinfo-data
|
|
185
|
+
uglifier (>= 1.3.0)
|
|
186
|
+
web-console (>= 3.3.0)
|
|
187
|
+
|
|
188
|
+
BUNDLED WITH
|
|
189
|
+
1.13.6
|