devise_invitable 2.0.4 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of devise_invitable might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/devise_invitable/models.rb +3 -1
- data/lib/devise_invitable/version.rb +1 -1
- data/test/models/invitable_test.rb +8 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0517f954240bfc3c1fd255df0d502d5fdbd461d4e695cd0c5ec725854af50dcf
|
4
|
+
data.tar.gz: 239b887a32e66dbc38fbf1e04625def2f1dea325fcc6d20af0e1befd066dd000
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 957006ebe6e94715459f941b52004a1002e72005e9344baca46679398bc34e360604e3a8a205d9099a4ff5015be597c1c02a89055137db6c12f10ecf03949db7
|
7
|
+
data.tar.gz: 17200aa6cf76d5abf07de1e4c0987f197140087a7a3210df0bf948a6098602eeeab05d65983cc69ef2185f2de741813ebc778a28d476a86bc5b1527bbd918f4c
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 2.0.5
|
2
|
+
- Fix NoMethodError in random_password when validatable is not used ([#850](https://github.com/scambra/devise_invitable/pull/850))
|
3
|
+
|
1
4
|
## 2.0.4
|
2
5
|
- Fix devise deprecations ([#842](https://github.com/scambra/devise_invitable/pull/842))
|
3
6
|
- Update translations ([#844](https://github.com/scambra/devise_invitable/pull/844), [#845](https://github.com/scambra/devise_invitable/pull/845))
|
@@ -397,8 +397,10 @@ module Devise
|
|
397
397
|
# lower + upper case, a digit and a symbol.
|
398
398
|
# For more unusual rules, this method can be overridden.
|
399
399
|
def random_password
|
400
|
+
length = respond_to?(:password_length) ? password_length : Devise.password_length
|
401
|
+
|
400
402
|
prefix = 'aA1!'
|
401
|
-
prefix + Devise.friendly_token(
|
403
|
+
prefix + Devise.friendly_token(length.last - prefix.length)
|
402
404
|
end
|
403
405
|
end
|
404
406
|
end
|
@@ -765,9 +765,15 @@ class InvitableTest < ActiveSupport::TestCase
|
|
765
765
|
assert user.errors.empty?
|
766
766
|
end
|
767
767
|
|
768
|
-
test 'should set initial password following
|
768
|
+
test 'should set initial password following Devise.password_length' do
|
769
|
+
user = User.invite!(email: 'valid@email.com')
|
770
|
+
assert_empty user.errors
|
771
|
+
assert_equal Devise.password_length.last, user.password.length
|
772
|
+
end
|
773
|
+
|
774
|
+
test 'should set initial passsword using :validatable with custom password_length' do
|
769
775
|
user = Validatable.invite!(email: 'valid@email.com')
|
770
|
-
user.update_attributes(profile_id: 1)
|
771
776
|
assert_empty user.errors
|
777
|
+
assert_equal Validatable.password_length.last, user.password.length
|
772
778
|
end
|
773
779
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_invitable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergio Cambra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionmailer
|