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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1f6c20540e06ef03d433a86d14ee5f7300b94146a1b9019b2c81a88edc72925
4
- data.tar.gz: 3e14cce59ae14f024bba1213c11b91bf90f839cfe0c01ed4f9fcf0bbdbdd1e12
3
+ metadata.gz: 2565382823ed8ab4f837160c54a053df8076a441e2f197802e152932b77634f6
4
+ data.tar.gz: 385ae0a6a352ce1343bea96e30a26fe1d8adf4939615deaf963df87c964b1909
5
5
  SHA512:
6
- metadata.gz: 3595bdad371be1ca01a2fc6563b8aaba6da01e9c8bca8cf7bec9933d5fb58a8b045cf7b2cddd3440aa7dd623cd64e1d11cc53d8bce1e874d14bed0f54cc39fdd
7
- data.tar.gz: 7b75589a85f83282eacdaf95911ac75572e0bc2336fe8f1bcf46e700cab71ffdeb470d36a59c5db55ed132ee6f07449ba57d5a11d4f2efb455c749f127eeb8d3
6
+ metadata.gz: 5faba7eb1f3f7e04d862954f7cc40d1bf94a08ad7ccbdff2383d6419cb4d5d13f02f3cdf98876275faf3a70be39f6345215440add7cbe888818ead45d05c3855
7
+ data.tar.gz: 73cf0ce8bff419342f769e61f0c3c7455fec01a3733c17afb6337e7e15e798b5de244971e5dd02889ba7c60cbf7c3f53c35e45ca8bca853f0548362353093529
data/.gitignore CHANGED
@@ -10,3 +10,4 @@
10
10
  /spec/rails_app/log/*
11
11
  /.ruby-version
12
12
  /.idea/
13
+ /gemfiles/*gemfile.lock
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
- before_install: gem install bundler
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
@@ -1,3 +1,6 @@
1
+ ### Unreleased
2
+ * Fix ActiveModel::Errors#keys deprecation in Rails 6.1
3
+
1
4
  ### 3.0.0 - 2019-11-06
2
5
  * Deprecate the support of Rails 4 (although it might still work)
3
6
  * Fix warnings in Rails 6
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`, _devise-multi_email_ has been tested with Devise 4.0 and rails 4.2:
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 exiting user records](https://github.com/allenwq/devise-multi_email/wiki/Migrating-existing-user-records)
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 `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
183
+ After checking out the repo, run `bundle install` to install dependencies.
184
184
 
185
- 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).
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/[USERNAME]/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.
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.4)
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.0)
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.4)
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)
@@ -1,5 +1,5 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem "rails", "~> 4.2.8"
3
+ gem "rails", ">= 6.0.2.1", "< 6.1"
4
4
 
5
5
  gemspec path: "../"
@@ -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: Devise.allow_unconfirmed_access_for > 0.days)
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 = errors.keys.detect do |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.
@@ -1,5 +1,5 @@
1
1
  module Devise
2
2
  module MultiEmail
3
- VERSION = "3.0.0"
3
+ VERSION = "3.0.1"
4
4
  end
5
5
  end
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.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: 2019-11-06 00:00:00.000000000 Z
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
- rubyforge_project:
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.
@@ -1,6 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "rails", "~> 5.0.3"
4
- gem 'sqlite3'
5
-
6
- gemspec path: "../"