devise-multi_email 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +8 -1
- data/CHANGELOG.md +3 -0
- data/README.md +5 -5
- data/examples/rails5_app/Gemfile.lock +3 -3
- data/gemfiles/{rails_4_2.gemfile → rails_6_0.gemfile} +1 -1
- data/lib/devise/multi_email/models/confirmable.rb +6 -1
- data/lib/devise/multi_email/models/validatable.rb +5 -1
- data/lib/devise/multi_email/version.rb +1 -1
- metadata +4 -6
- data/gemfiles/rails_5_0.gemfile +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2565382823ed8ab4f837160c54a053df8076a441e2f197802e152932b77634f6
|
4
|
+
data.tar.gz: 385ae0a6a352ce1343bea96e30a26fe1d8adf4939615deaf963df87c964b1909
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5faba7eb1f3f7e04d862954f7cc40d1bf94a08ad7ccbdff2383d6419cb4d5d13f02f3cdf98876275faf3a70be39f6345215440add7cbe888818ead45d05c3855
|
7
|
+
data.tar.gz: 73cf0ce8bff419342f769e61f0c3c7455fec01a3733c17afb6337e7e15e798b5de244971e5dd02889ba7c60cbf7c3f53c35e45ca8bca853f0548362353093529
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
language: ruby
|
2
|
+
|
2
3
|
rvm:
|
3
4
|
- 2.4
|
4
5
|
- 2.5
|
@@ -6,4 +7,10 @@ rvm:
|
|
6
7
|
gemfile:
|
7
8
|
- gemfiles/rails_5_2.gemfile
|
8
9
|
- gemfiles/rails_5_1.gemfile
|
9
|
-
|
10
|
+
- gemfiles/rails_6_0.gemfile
|
11
|
+
|
12
|
+
jobs:
|
13
|
+
exclude:
|
14
|
+
- rvm: 2.4
|
15
|
+
gemfile: gemfiles/rails_6_0.gemfile
|
16
|
+
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -10,7 +10,7 @@ Letting [Devise](https://github.com/plataformatec/devise) support multiple email
|
|
10
10
|
|
11
11
|
## Getting Started
|
12
12
|
|
13
|
-
Add this line to your application's `Gemfile
|
13
|
+
Add this line to your application's `Gemfile`:
|
14
14
|
|
15
15
|
```ruby
|
16
16
|
gem 'devise-multi_email'
|
@@ -176,17 +176,17 @@ You can do `email.send_confirmation_instructions` for each email individually, b
|
|
176
176
|
|
177
177
|
## Wiki
|
178
178
|
|
179
|
-
[Migrating
|
179
|
+
[Migrating existing user records](https://github.com/allenwq/devise-multi_email/wiki/Migrating-existing-user-records)
|
180
180
|
|
181
181
|
## Development
|
182
182
|
|
183
|
-
After checking out the repo, run `
|
183
|
+
After checking out the repo, run `bundle install` to install dependencies.
|
184
184
|
|
185
|
-
|
185
|
+
Then, run `bundle exec rake` to run the RSpec test suite.
|
186
186
|
|
187
187
|
## Contributing
|
188
188
|
|
189
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
189
|
+
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.
|
190
190
|
|
191
191
|
|
192
192
|
## License
|
@@ -43,7 +43,7 @@ GEM
|
|
43
43
|
builder (3.2.3)
|
44
44
|
byebug (9.0.6)
|
45
45
|
concurrent-ruby (1.1.5)
|
46
|
-
crass (1.0.
|
46
|
+
crass (1.0.5)
|
47
47
|
debug_inspector (0.0.2)
|
48
48
|
devise (4.7.1)
|
49
49
|
bcrypt (~> 3.0)
|
@@ -72,7 +72,7 @@ GEM
|
|
72
72
|
listen (3.0.8)
|
73
73
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
74
74
|
rb-inotify (~> 0.9, >= 0.9.7)
|
75
|
-
loofah (2.3.
|
75
|
+
loofah (2.3.1)
|
76
76
|
crass (~> 1.0.2)
|
77
77
|
nokogiri (>= 1.5.9)
|
78
78
|
mail (2.6.4)
|
@@ -85,7 +85,7 @@ GEM
|
|
85
85
|
minitest (5.12.2)
|
86
86
|
multi_json (1.12.1)
|
87
87
|
nio4r (2.0.0)
|
88
|
-
nokogiri (1.10.
|
88
|
+
nokogiri (1.10.5)
|
89
89
|
mini_portile2 (~> 2.4.0)
|
90
90
|
orm_adapter (0.5.0)
|
91
91
|
puma (3.7.1)
|
@@ -48,7 +48,7 @@ module Devise
|
|
48
48
|
# In case email updates are being postponed, don't change anything
|
49
49
|
# when the postpone feature tries to switch things back
|
50
50
|
def email=(new_email)
|
51
|
-
multi_email.change_primary_email_to(new_email, allow_unconfirmed:
|
51
|
+
multi_email.change_primary_email_to(new_email, allow_unconfirmed: unconfirmed_access_possible?)
|
52
52
|
end
|
53
53
|
|
54
54
|
# This need to be forwarded to the email that the user logged in with
|
@@ -94,6 +94,11 @@ module Devise
|
|
94
94
|
|
95
95
|
private
|
96
96
|
|
97
|
+
def unconfirmed_access_possible?
|
98
|
+
Devise.allow_unconfirmed_access_for.nil? || \
|
99
|
+
Devise.allow_unconfirmed_access_for > 0.days
|
100
|
+
end
|
101
|
+
|
97
102
|
module ClassMethods
|
98
103
|
delegate :confirm_by_token, :send_confirmation_instructions, to: 'multi_email_association.model_class', allow_nil: false
|
99
104
|
end
|
@@ -66,7 +66,7 @@ module Devise
|
|
66
66
|
|
67
67
|
def propagate_email_errors
|
68
68
|
association_name = self.class.multi_email_association.name
|
69
|
-
email_error_key =
|
69
|
+
email_error_key = errors_attribute_names.detect do |key|
|
70
70
|
[association_name.to_s, "#{association_name}.email"].include?(key.to_s)
|
71
71
|
end
|
72
72
|
return unless email_error_key.present?
|
@@ -86,6 +86,10 @@ module Devise
|
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
89
|
+
def errors_attribute_names
|
90
|
+
errors.respond_to?(:attribute_names) ? errors.attribute_names : errors.keys
|
91
|
+
end
|
92
|
+
|
89
93
|
module ClassMethods
|
90
94
|
|
91
95
|
# All validations used by this module.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise-multi_email
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ALLEN WANG QIANG
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-04-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: devise
|
@@ -210,10 +210,9 @@ files:
|
|
210
210
|
- examples/rails5_app/tmp/.keep
|
211
211
|
- examples/rails5_app/vendor/assets/javascripts/.keep
|
212
212
|
- examples/rails5_app/vendor/assets/stylesheets/.keep
|
213
|
-
- gemfiles/rails_4_2.gemfile
|
214
|
-
- gemfiles/rails_5_0.gemfile
|
215
213
|
- gemfiles/rails_5_1.gemfile
|
216
214
|
- gemfiles/rails_5_2.gemfile
|
215
|
+
- gemfiles/rails_6_0.gemfile
|
217
216
|
- lib/devise/multi_email.rb
|
218
217
|
- lib/devise/multi_email/association_manager.rb
|
219
218
|
- lib/devise/multi_email/email_model_extensions.rb
|
@@ -243,8 +242,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
243
242
|
- !ruby/object:Gem::Version
|
244
243
|
version: '0'
|
245
244
|
requirements: []
|
246
|
-
|
247
|
-
rubygems_version: 2.7.9
|
245
|
+
rubygems_version: 3.0.3.1
|
248
246
|
signing_key:
|
249
247
|
specification_version: 4
|
250
248
|
summary: Let devise support multiple emails.
|