devise_invitable 2.0.9 → 2.0.12
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 +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +696 -0
- data/config/locales/fr.yml +4 -5
- data/config/locales/it.yml +2 -2
- data/config/locales/pt-BR.yml +2 -2
- data/config/locales/zh-CN.yml +31 -0
- data/config/locales/zh-TW.yml +15 -12
- data/lib/devise_invitable/models.rb +7 -7
- data/lib/devise_invitable/version.rb +1 -1
- data/test/orm/active_record.rb +9 -9
- data/test/test_helper.rb +9 -1
- metadata +6 -8
- data/README.rdoc +0 -496
data/config/locales/fr.yml
CHANGED
|
@@ -4,14 +4,13 @@ fr:
|
|
|
4
4
|
invited: "Vous avez une invitation en attente, acceptez-la pour terminer la création de votre compte."
|
|
5
5
|
invitations:
|
|
6
6
|
send_instructions: "Un e-mail d'invitation a été envoyé à %{email}."
|
|
7
|
-
invitation_token_invalid: "Le jeton d'invitation fourni n'est pas valide!"
|
|
7
|
+
invitation_token_invalid: "Le jeton d'invitation fourni n'est pas valide !"
|
|
8
8
|
updated: 'Votre mot de passe a été défini avec succès. Vous êtes maintenant connecté.'
|
|
9
9
|
updated_not_active: "Votre mot de passe a été défini avec succès."
|
|
10
|
-
no_invitations_remaining: "Il n'y a plus d'invitations restantes"
|
|
10
|
+
no_invitations_remaining: "Il n'y a plus d'invitations restantes."
|
|
11
11
|
invitation_removed: 'Votre invitation a été supprimée.'
|
|
12
12
|
new:
|
|
13
13
|
header: Nouvel utilisateur
|
|
14
|
-
legend: Envoyer l’invitation
|
|
15
14
|
submit_button: Envoyer
|
|
16
15
|
edit:
|
|
17
16
|
header: Définissez votre mot de passe
|
|
@@ -23,10 +22,10 @@ fr:
|
|
|
23
22
|
someone_invited_you: "Vous avez été invité à rejoindre %{url}, vous pouvez accepter cette invitation via le lien ci-dessous."
|
|
24
23
|
accept: "Accepter l'invitation"
|
|
25
24
|
accept_until: "Cette invitation sera valable jusqu'au %{due_date}."
|
|
26
|
-
ignore: "Si vous ne souhaitez pas accepter cette invitation, veuillez ignorer cet e-mail
|
|
25
|
+
ignore: "Si vous ne souhaitez pas accepter cette invitation, veuillez ignorer cet e-mail. Votre compte ne sera pas créé tant que vous n'aurez pas cliqué sur le lien ci-dessous et défini votre mot de passe."
|
|
27
26
|
time:
|
|
28
27
|
formats:
|
|
29
28
|
devise:
|
|
30
29
|
mailer:
|
|
31
30
|
invitation_instructions:
|
|
32
|
-
accept_until_format: "%
|
|
31
|
+
accept_until_format: "%d %B %Y à %H:%M"
|
data/config/locales/it.yml
CHANGED
|
@@ -22,10 +22,10 @@ it:
|
|
|
22
22
|
someone_invited_you: "Qualcuno ti ha invitato a %{url}, accetta tramite il link qua sotto."
|
|
23
23
|
accept: "Accetta l'invito"
|
|
24
24
|
accept_until: "L'invito sarà valido fino a %{due_date}."
|
|
25
|
-
ignore: "Se non si desidera accettare l'invito si prega di ignorare la presente email.<br />L'account non sarà creato finché non verrà impostata la password
|
|
25
|
+
ignore: "Se non si desidera accettare l'invito si prega di ignorare la presente email.<br />L'account non sarà creato finché non verrà impostata la password tramite il link precedente."
|
|
26
26
|
time:
|
|
27
27
|
formats:
|
|
28
28
|
devise:
|
|
29
29
|
mailer:
|
|
30
30
|
invitation_instructions:
|
|
31
|
-
accept_until_format: "%B %d, %Y %I:%M %p"
|
|
31
|
+
accept_until_format: "%B %d, %Y %I:%M %p"
|
data/config/locales/pt-BR.yml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
pt-BR:
|
|
2
2
|
devise:
|
|
3
3
|
failure:
|
|
4
4
|
invited: 'Você tem um convite pendente, aceite para finalizar sua conta.'
|
|
@@ -20,4 +20,4 @@ pt_BR:
|
|
|
20
20
|
hello: 'Olá %{email}'
|
|
21
21
|
someone_invited_you: 'Alguém convidou você para acessar %{url}, você pode aceitar o convite através do link abaixo.'
|
|
22
22
|
accept: 'Aceitar convite'
|
|
23
|
-
ignore: "Se você não quer aceitar esse convite, por favor ignore esse e-mail.<br />Sua conta não será criada até você acessar o link abaixo e escolher sua senha."
|
|
23
|
+
ignore: "Se você não quer aceitar esse convite, por favor ignore esse e-mail.<br />Sua conta não será criada até você acessar o link abaixo e escolher sua senha."
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
zh-CN:
|
|
2
|
+
devise:
|
|
3
|
+
failure:
|
|
4
|
+
invited: "您有一封待处理的帐号邀请,请接受邀请完成创建您的帐号。"
|
|
5
|
+
invitations:
|
|
6
|
+
send_instructions: "邀请电子邮件已发送至 %{email}。"
|
|
7
|
+
invitation_token_invalid: "所提供的邀请验证无效!"
|
|
8
|
+
updated: "您的密码已设置成功,。现在您已经登入了。"
|
|
9
|
+
updated_not_active: "您的密码已设置成功。"
|
|
10
|
+
no_invitations_remaining: "没有待处理的邀请"
|
|
11
|
+
invitation_removed: "您的邀请被删除了。"
|
|
12
|
+
new:
|
|
13
|
+
header: "发送邀请"
|
|
14
|
+
submit_button: "发送邀请"
|
|
15
|
+
edit:
|
|
16
|
+
header: "设置您的密码"
|
|
17
|
+
submit_button: "设置密码"
|
|
18
|
+
mailer:
|
|
19
|
+
invitation_instructions:
|
|
20
|
+
subject: "邀请"
|
|
21
|
+
hello: "%{email} 您好"
|
|
22
|
+
someone_invited_you: "邀请您加入 %{url},您可以通过以下的网页链接接受邀请,并创设帐号:"
|
|
23
|
+
accept: "接受邀请"
|
|
24
|
+
accept_until: "这封邀请将于 %{due_date} 到期。"
|
|
25
|
+
ignore: "如果您不想接受邀请,请忽略这封电子邮件。只要未选取上述“接受邀请”的链接并且设置密码,您的帐号就不会成立。"
|
|
26
|
+
time:
|
|
27
|
+
formats:
|
|
28
|
+
devise:
|
|
29
|
+
mailer:
|
|
30
|
+
invitation_instructions:
|
|
31
|
+
accept_until_format: "%B %d, %Y %I:%M %p"
|
data/config/locales/zh-TW.yml
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
zh-TW:
|
|
2
2
|
devise:
|
|
3
3
|
failure:
|
|
4
|
-
invited: "
|
|
4
|
+
invited: "你有一封設立帳號的邀請,請接受邀請來創建你的帳號。"
|
|
5
5
|
invitations:
|
|
6
|
-
send_instructions: "邀請已發送至%{email)
|
|
7
|
-
invitation_token_invalid: "
|
|
8
|
-
updated: "
|
|
9
|
-
updated_not_active: "
|
|
10
|
-
no_invitations_remaining: "
|
|
11
|
-
invitation_removed: "
|
|
6
|
+
send_instructions: "邀請已發送至%{email)"
|
|
7
|
+
invitation_token_invalid: "所提供的邀請驗證無效!"
|
|
8
|
+
updated: "你的密碼已設置成功,現在你已經登入了。"
|
|
9
|
+
updated_not_active: "密碼設置成功"
|
|
10
|
+
no_invitations_remaining: "邀請名額已用盡"
|
|
11
|
+
invitation_removed: "你的邀請被刪除了"
|
|
12
12
|
new:
|
|
13
13
|
header: "發送邀請"
|
|
14
14
|
submit_button: "發送邀請"
|
|
@@ -17,12 +17,15 @@ zh-TW:
|
|
|
17
17
|
submit_button: "設置密碼"
|
|
18
18
|
mailer:
|
|
19
19
|
invitation_instructions:
|
|
20
|
-
subject: "
|
|
21
|
-
hello: "%{email}
|
|
22
|
-
someone_invited_you:
|
|
20
|
+
subject: "邀請"
|
|
21
|
+
hello: "%{email} 你好,"
|
|
22
|
+
someone_invited_you: “邀請你加入%{url}。你可以通過以下的網頁連結接受邀請,並創設帳號:"
|
|
23
23
|
accept: "接受邀請"
|
|
24
|
-
accept_until: "
|
|
25
|
-
ignore:
|
|
24
|
+
accept_until: "這封邀請將於 %{due_date} 到期。"
|
|
25
|
+
ignore:
|
|
26
|
+
"如果你不想接受邀請,
|
|
27
|
+
請忽略這封電子郵件。只要未選取上述“接受邀請”的連結並且設置密碼,你的帳號就不會成立。"
|
|
28
|
+
|
|
26
29
|
time:
|
|
27
30
|
formats:
|
|
28
31
|
devise:
|
|
@@ -30,12 +30,12 @@ module Devise
|
|
|
30
30
|
|
|
31
31
|
included do
|
|
32
32
|
include ::DeviseInvitable::Inviter
|
|
33
|
-
belongs_to_options = if
|
|
34
|
-
{ class_name:
|
|
33
|
+
belongs_to_options = if invited_by_class_name
|
|
34
|
+
{ class_name: invited_by_class_name }
|
|
35
35
|
else
|
|
36
36
|
{ polymorphic: true }
|
|
37
37
|
end
|
|
38
|
-
if fk =
|
|
38
|
+
if fk = invited_by_foreign_key
|
|
39
39
|
belongs_to_options[:foreign_key] = fk
|
|
40
40
|
end
|
|
41
41
|
if defined?(ActiveRecord) && defined?(ActiveRecord::Base) && self < ActiveRecord::Base
|
|
@@ -76,9 +76,9 @@ module Devise
|
|
|
76
76
|
|
|
77
77
|
def self.required_fields(klass)
|
|
78
78
|
fields = [:invitation_token, :invitation_created_at, :invitation_sent_at, :invitation_accepted_at,
|
|
79
|
-
:invitation_limit,
|
|
79
|
+
:invitation_limit, klass.invited_by_foreign_key || :invited_by_id, :invited_by_type]
|
|
80
80
|
fields << :invitations_count if defined?(ActiveRecord) && self < ActiveRecord::Base
|
|
81
|
-
fields -= [:invited_by_type] if
|
|
81
|
+
fields -= [:invited_by_type] if klass.invited_by_class_name
|
|
82
82
|
fields
|
|
83
83
|
end
|
|
84
84
|
|
|
@@ -222,9 +222,9 @@ module Devise
|
|
|
222
222
|
|
|
223
223
|
def invitation_due_at
|
|
224
224
|
return nil if (self.class.invite_for == 0 || self.class.invite_for.nil?)
|
|
225
|
-
#return nil unless self.class.invite_for
|
|
226
225
|
|
|
227
|
-
time = self.invitation_created_at || self.invitation_sent_at
|
|
226
|
+
return unless (time = self.invitation_created_at || self.invitation_sent_at)
|
|
227
|
+
|
|
228
228
|
time + self.class.invite_for
|
|
229
229
|
end
|
|
230
230
|
|
data/test/orm/active_record.rb
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
ActiveRecord::Migration.verbose = false
|
|
2
2
|
ActiveRecord::Base.logger = Logger.new(nil)
|
|
3
3
|
|
|
4
|
-
if ActiveRecord::VERSION::MAJOR >=
|
|
4
|
+
if ActiveRecord::VERSION::MAJOR >= 7
|
|
5
5
|
ActiveRecord::MigrationContext.new(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
end
|
|
6
|
+
File.expand_path('../../rails_app/db/migrate/', __FILE__)
|
|
7
|
+
).migrate
|
|
8
|
+
else # rails 6
|
|
9
|
+
ActiveRecord::MigrationContext.new(
|
|
10
|
+
File.expand_path('../../rails_app/db/migrate/', __FILE__),
|
|
11
|
+
ActiveRecord::Base.connection.schema_migration
|
|
12
|
+
).migrate
|
|
13
|
+
end
|
data/test/test_helper.rb
CHANGED
|
@@ -13,7 +13,9 @@ ActionMailer::Base.delivery_method = :test
|
|
|
13
13
|
ActionMailer::Base.perform_deliveries = true
|
|
14
14
|
ActionMailer::Base.default_url_options[:host] = 'example.com'
|
|
15
15
|
|
|
16
|
-
ActiveSupport::Deprecation.silenced
|
|
16
|
+
if ActiveSupport::Deprecation.respond_to?(:silenced=)
|
|
17
|
+
ActiveSupport::Deprecation.silenced = true
|
|
18
|
+
end
|
|
17
19
|
$VERBOSE = false
|
|
18
20
|
|
|
19
21
|
class ActionDispatch::IntegrationTest
|
|
@@ -31,3 +33,9 @@ class ActionController::TestCase
|
|
|
31
33
|
self.use_transactional_tests = true
|
|
32
34
|
end
|
|
33
35
|
end
|
|
36
|
+
|
|
37
|
+
# This is a workaround for the issue with Rails 8.0 and lazy loading of routes.
|
|
38
|
+
# see: https://github.com/heartcombo/devise/issues/5705
|
|
39
|
+
if Rails.gem_version >= Gem::Version.new('8.0')
|
|
40
|
+
Rails.application.routes_reloader.execute_unless_loaded
|
|
41
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
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.12
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sergio Cambra
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: actionmailer
|
|
@@ -62,7 +61,7 @@ extra_rdoc_files: []
|
|
|
62
61
|
files:
|
|
63
62
|
- CHANGELOG.md
|
|
64
63
|
- LICENSE
|
|
65
|
-
- README.
|
|
64
|
+
- README.md
|
|
66
65
|
- app/controllers/devise/invitations_controller.rb
|
|
67
66
|
- app/controllers/devise_invitable/registrations_controller.rb
|
|
68
67
|
- app/views/devise/invitations/edit.html.erb
|
|
@@ -91,6 +90,7 @@ files:
|
|
|
91
90
|
- config/locales/tr.yml
|
|
92
91
|
- config/locales/ua.yml
|
|
93
92
|
- config/locales/vi.yml
|
|
93
|
+
- config/locales/zh-CN.yml
|
|
94
94
|
- config/locales/zh-HK.yml
|
|
95
95
|
- config/locales/zh-TW.yml
|
|
96
96
|
- lib/devise_invitable.rb
|
|
@@ -170,10 +170,9 @@ homepage: https://github.com/scambra/devise_invitable
|
|
|
170
170
|
licenses:
|
|
171
171
|
- MIT
|
|
172
172
|
metadata: {}
|
|
173
|
-
post_install_message:
|
|
174
173
|
rdoc_options:
|
|
175
174
|
- "--main"
|
|
176
|
-
- README.
|
|
175
|
+
- README.md
|
|
177
176
|
- "--charset=UTF-8"
|
|
178
177
|
require_paths:
|
|
179
178
|
- lib
|
|
@@ -188,8 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
188
187
|
- !ruby/object:Gem::Version
|
|
189
188
|
version: '0'
|
|
190
189
|
requirements: []
|
|
191
|
-
rubygems_version: 3.
|
|
192
|
-
signing_key:
|
|
190
|
+
rubygems_version: 3.6.9
|
|
193
191
|
specification_version: 4
|
|
194
192
|
summary: An invitation strategy for Devise
|
|
195
193
|
test_files:
|