devise_invitable 2.0.3 → 2.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 853e0a1f85a22c77e6caa07a56e90cde6f0b54ad39651a756f73d213f2d8a085
4
- data.tar.gz: a824c95001fb09a4b9c2b11809c46bf7a4cc1ca667166889a1d8d0f8a3f842d0
3
+ metadata.gz: 33d2068bde4821b3e6002383cd125e0be3710fea488c593c732401e73daeb5ab
4
+ data.tar.gz: 9b7d81c9a6a8c288b083b932571e09826f1161fcba0f0a5147ce8f140037ec79
5
5
  SHA512:
6
- metadata.gz: 48e4376634d9c32e9703a635b9676c7aa6859ad5c9abaa7a301538d7b918871340304c0897fbf8b7c950398065a7254c88ecbc951f747bc4e3edb91a59a0baaf
7
- data.tar.gz: b5a98b61c21f14585205679a0577194df7c542214552970e9fa9eb0b6c81f93f35a7fd4fbf443904e1d25f4c817dd32dfca69f160b93d71c26bcc67e992c1f4a
6
+ metadata.gz: e6498c6caff72695aa36dd8092643f7d00eaf85022157d746c80c19228d43231372a0ef7a66e21ec817b8f8e477aff3db8a62c77197295ff8ef16827301d27a9
7
+ data.tar.gz: 4e91e65cd46d4ee92b6efb2f47fbf0db7625b534e8e9efc9a3d25aa3bab483bdaf41d60e480c0dac5c42aa164043a5e669ca13e74302074ac6b8a79c1e338ca0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 2.0.4
2
+ - Fix devise deprecations ([#842](https://github.com/scambra/devise_invitable/pull/842))
3
+ - Update translations ([#844](https://github.com/scambra/devise_invitable/pull/844), [#845](https://github.com/scambra/devise_invitable/pull/845))
4
+ - Fix/enforce initial password length to follow devise ([#848](https://github.com/scambra/devise_invitable/pull/848))
5
+
1
6
  ## 2.0.3
2
7
  - Add locales ([#834](https://github.com/scambra/devise_invitable/pull/834), [#835](https://github.com/scambra/devise_invitable/pull/835))
3
8
  - Remove index on invitations_count column ([#830](https://github.com/scambra/devise_invitable/pull/830))
data/README.rdoc CHANGED
@@ -181,15 +181,15 @@ To change behaviour of inviting or accepting users, you can simply override two
181
181
  class Users::InvitationsController < Devise::InvitationsController
182
182
  private
183
183
 
184
- # this is called when creating invitation
185
- # should return an instance of resource class
184
+ # This is called when creating invitation.
185
+ # It should return an instance of resource class.
186
186
  def invite_resource
187
187
  # skip sending emails on invite
188
188
  super { |user| user.skip_invitation = true }
189
189
  end
190
190
 
191
- # this is called when accepting invitation
192
- # should return an instance of resource class
191
+ # This is called when accepting invitation.
192
+ # It should return an instance of resource class.
193
193
  def accept_resource
194
194
  resource = resource_class.accept_invitation!(update_resource_params)
195
195
  # Report accepting invitation to analytics
@@ -18,7 +18,7 @@ es:
18
18
  mailer:
19
19
  invitation_instructions:
20
20
  subject: "Instruciones de la invitación"
21
- hello: "Estimada/o %{nombre}"
21
+ hello: "Hola %{email}"
22
22
  someone_invited_you: "Has sido invitado a %{url}, puedes aceptarlo siguiendo el siguiente enlace"
23
23
  accept: "Aceptar la invitación"
24
24
  accept_until: "Esta invitación expirará en %{due_date}."
@@ -28,4 +28,4 @@ es:
28
28
  devise:
29
29
  mailer:
30
30
  invitation_instructions:
31
- accept_until_format: "%d de %B de %Y, %H:%M"
31
+ accept_until_format: "%d de %B de %Y, %H:%M"
@@ -20,7 +20,6 @@ ja:
20
20
  subject: '招待を承認するには'
21
21
  hello: 'こんにちは、%{email}さん'
22
22
  someone_invited_you: '%{url}に招待されました。以下のリンクから承認できます。'
23
- accept: 'Accept invitation'
24
23
  accept: '招待を承認する'
25
24
  accept_until: 'この招待は%{due_date}まで有効です。'
26
25
  ignore: '招待を承認しない場合は、このメールを無視してください。<br />あなたのアカウントは上記のリンク先にアクセスしパスワードを設定するまでは作成されません。'
@@ -397,7 +397,8 @@ 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
- 'aA1!' + Devise.friendly_token[0, 20]
400
+ prefix = 'aA1!'
401
+ prefix + Devise.friendly_token(self.password_length.last-prefix.length)
401
402
  end
402
403
  end
403
404
  end
@@ -1,11 +1,17 @@
1
1
  module Devise
2
2
  module Models
3
3
  module Authenticatable
4
- BLACKLIST_FOR_SERIALIZATION.concat %i[
4
+ list = %i[
5
5
  invitation_token invitation_created_at invitation_sent_at
6
6
  invitation_accepted_at invitation_limit invited_by_type
7
7
  invited_by_id invitations_count
8
8
  ]
9
+
10
+ if defined?(UNSAFE_ATTRIBUTES_FOR_SERIALIZATION)
11
+ UNSAFE_ATTRIBUTES_FOR_SERIALIZATION.concat(list)
12
+ else
13
+ BLACKLIST_FOR_SERIALIZATION.concat(list)
14
+ end
9
15
  end
10
16
  end
11
17
  end
@@ -1,3 +1,3 @@
1
1
  module DeviseInvitable
2
- VERSION = '2.0.3'.freeze
2
+ VERSION = '2.0.4'.freeze
3
3
  end
@@ -1,6 +1,10 @@
1
1
  require 'test_helper'
2
2
  require 'model_tests_helper'
3
3
 
4
+ class Validatable < User
5
+ devise :validatable, password_length: 10..20
6
+ end
7
+
4
8
  class InvitableTest < ActiveSupport::TestCase
5
9
 
6
10
  def setup
@@ -760,4 +764,10 @@ class InvitableTest < ActiveSupport::TestCase
760
764
  assert user.persisted?
761
765
  assert user.errors.empty?
762
766
  end
767
+
768
+ test 'should set initial password following devise password_length' do
769
+ user = Validatable.invite!(email: 'valid@email.com')
770
+ user.update_attributes(profile_id: 1)
771
+ assert_empty user.errors
772
+ end
763
773
  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.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Cambra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-20 00:00:00.000000000 Z
11
+ date: 2021-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer
@@ -186,8 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
186
186
  - !ruby/object:Gem::Version
187
187
  version: '0'
188
188
  requirements: []
189
- rubyforge_project:
190
- rubygems_version: 2.7.9
189
+ rubygems_version: 3.0.8
191
190
  signing_key:
192
191
  specification_version: 4
193
192
  summary: An invitation strategy for Devise