devise_invitable 1.7.5 → 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 +24 -0
- data/README.rdoc +98 -111
- data/app/controllers/devise/invitations_controller.rb +41 -40
- data/app/controllers/devise_invitable/registrations_controller.rb +11 -11
- data/app/views/devise/invitations/edit.html.erb +14 -8
- data/app/views/devise/invitations/new.html.erb +11 -7
- data/app/views/devise/mailer/invitation_instructions.html.erb +1 -1
- data/app/views/devise/mailer/invitation_instructions.text.erb +1 -1
- data/config/locales/ar.yml +23 -0
- data/config/locales/da.yml +41 -0
- data/config/locales/de.yml +31 -0
- data/config/locales/es.yml +31 -0
- data/config/locales/et.yml +23 -0
- data/config/locales/fa.yml +31 -0
- data/config/locales/fr.yml +34 -0
- data/config/locales/it.yml +31 -0
- data/config/locales/ja.yml +31 -0
- data/config/locales/ko.yml +24 -0
- data/config/locales/nl.yml +32 -0
- data/config/locales/no.yml +17 -0
- data/config/locales/pl.yml +31 -0
- data/config/locales/pt-BR.yml +23 -0
- data/config/locales/pt.yml +23 -0
- data/config/locales/ru.yml +23 -0
- data/config/locales/tr.yml +24 -0
- data/config/locales/ua.yml +31 -0
- data/config/locales/vi.yml +25 -0
- data/config/locales/zh-HK.yml +31 -0
- data/config/locales/zh-TW.yml +31 -0
- data/lib/devise_invitable.rb +5 -4
- data/lib/devise_invitable/controllers/helpers.rb +3 -4
- data/lib/devise_invitable/inviter.rb +4 -3
- data/lib/devise_invitable/mailer.rb +1 -1
- data/lib/devise_invitable/mapping.rb +6 -5
- data/lib/devise_invitable/models.rb +29 -27
- data/lib/devise_invitable/models/authenticatable.rb +7 -1
- data/lib/devise_invitable/parameter_sanitizer.rb +18 -18
- data/lib/devise_invitable/routes.rb +5 -5
- data/lib/devise_invitable/version.rb +1 -1
- data/lib/generators/active_record/devise_invitable_generator.rb +3 -3
- data/lib/generators/active_record/templates/migration.rb +0 -1
- data/lib/generators/devise_invitable/devise_invitable_generator.rb +4 -8
- data/lib/generators/devise_invitable/install_generator.rb +11 -14
- data/lib/generators/devise_invitable/templates/simple_form_for/invitations/edit.html.erb +10 -6
- data/lib/generators/devise_invitable/templates/simple_form_for/invitations/new.html.erb +10 -6
- data/lib/generators/devise_invitable/views_generator.rb +6 -6
- data/test/functional/registrations_controller_test.rb +24 -25
- data/test/generators/views_generator_test.rb +7 -6
- data/test/generators_test.rb +3 -2
- data/test/integration/invitation_remove_test.rb +8 -8
- data/test/integration/invitation_test.rb +46 -46
- data/test/integration_tests_helper.rb +8 -9
- data/test/model_tests_helper.rb +5 -5
- data/test/models/invitable_test.rb +126 -110
- data/test/models_test.rb +3 -3
- data/test/orm/active_record.rb +2 -2
- data/test/orm/mongoid.rb +2 -2
- data/test/rails_app/app/controllers/admins_controller.rb +4 -3
- data/test/rails_app/app/controllers/application_controller.rb +11 -10
- data/test/rails_app/app/controllers/free_invitations_controller.rb +12 -9
- data/test/rails_app/app/controllers/users_controller.rb +2 -2
- data/test/rails_app/app/models/admin.rb +7 -10
- data/test/rails_app/app/models/octopussy.rb +4 -4
- data/test/rails_app/app/models/user.rb +20 -20
- data/test/rails_app/app/views/admins/new.html.erb +9 -5
- data/test/rails_app/app/views/devise/sessions/new.html.erb +14 -6
- data/test/rails_app/app/views/free_invitations/new.html.erb +9 -5
- data/test/rails_app/app/views/layouts/application.html.erb +3 -4
- data/test/rails_app/app/views/users/invitations/new.html.erb +15 -9
- data/test/rails_app/config/application.rb +6 -6
- data/test/rails_app/config/boot.rb +2 -2
- data/test/rails_app/config/credentials.yml.enc +1 -0
- data/test/rails_app/config/initializers/devise.rb +4 -3
- data/test/rails_app/config/initializers/secret_token.rb +3 -1
- data/test/rails_app/config/initializers/session_store.rb +1 -1
- data/test/rails_app/config/initializers/wrap_parameters.rb +1 -1
- data/test/rails_app/config/master.key +1 -0
- data/test/rails_app/config/routes.rb +3 -3
- data/test/rails_app/db/migrate/20100401102949_create_tables.rb +0 -2
- data/test/routes_test.rb +4 -4
- data/test/test_helper.rb +6 -19
- metadata +46 -22
@@ -1,6 +1,6 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
|
-
RailsApp::Application.config.session_store :cookie_store, :
|
3
|
+
RailsApp::Application.config.session_store :cookie_store, key: '_test_app_session'
|
4
4
|
|
5
5
|
# Use the database for sessions instead of the cookie-based default,
|
6
6
|
# which shouldn't be used to store highly confidential information
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
7
|
ActiveSupport.on_load(:action_controller) do
|
8
|
-
wrap_parameters(:
|
8
|
+
wrap_parameters(format: [:json])
|
9
9
|
end
|
10
10
|
|
11
11
|
# Disable root element in JSON by default.
|
@@ -0,0 +1 @@
|
|
1
|
+
698ff206d79207132705d29c6a1c90b1
|
@@ -1,9 +1,9 @@
|
|
1
1
|
RailsApp::Application.routes.draw do
|
2
2
|
devise_for :users
|
3
3
|
devise_scope :user do
|
4
|
-
resource :free_invitation, :
|
5
|
-
resource :admin, :
|
4
|
+
resource :free_invitation, only: [:new, :create]
|
5
|
+
resource :admin, only: [:new, :create]
|
6
6
|
end
|
7
7
|
devise_for :admins
|
8
|
-
root :
|
8
|
+
root to: 'home#index'
|
9
9
|
end
|
@@ -32,7 +32,6 @@ class CreateTables < (Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRe
|
|
32
32
|
t.timestamps :null => false
|
33
33
|
end
|
34
34
|
add_index :users, :invitation_token, :unique => true
|
35
|
-
add_index :users, :invitations_count
|
36
35
|
|
37
36
|
create_table :admins do |t|
|
38
37
|
## Database authenticatable
|
@@ -41,6 +40,5 @@ class CreateTables < (Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRe
|
|
41
40
|
|
42
41
|
t.integer :invitations_count, :default => 0
|
43
42
|
end
|
44
|
-
add_index :admins, :invitations_count
|
45
43
|
end
|
46
44
|
end
|
data/test/routes_test.rb
CHANGED
@@ -3,18 +3,18 @@ require 'test_helper'
|
|
3
3
|
class RoutesTest < ActionController::TestCase
|
4
4
|
|
5
5
|
test 'map new user invitation' do
|
6
|
-
assert_recognizes({:
|
6
|
+
assert_recognizes({ controller: 'devise/invitations', action: 'new' }, { path: 'users/invitation/new', method: :get })
|
7
7
|
end
|
8
8
|
|
9
9
|
test 'map create user invitation' do
|
10
|
-
assert_recognizes({:
|
10
|
+
assert_recognizes({ controller: 'devise/invitations', action: 'create' }, { path: 'users/invitation', method: :post })
|
11
11
|
end
|
12
12
|
|
13
13
|
test 'map accept user invitation' do
|
14
|
-
assert_recognizes({:
|
14
|
+
assert_recognizes({ controller: 'devise/invitations', action: 'edit' }, 'users/invitation/accept')
|
15
15
|
end
|
16
16
|
|
17
17
|
test 'map update user invitation' do
|
18
|
-
assert_recognizes({:
|
18
|
+
assert_recognizes({ controller: 'devise/invitations', action: 'update' }, { path: 'users/invitation', method: :put })
|
19
19
|
end
|
20
20
|
end
|
data/test/test_helper.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
ENV[
|
2
|
-
DEVISE_ORM = (ENV[
|
1
|
+
ENV['RAILS_ENV'] = 'test'
|
2
|
+
DEVISE_ORM = (ENV['DEVISE_ORM'] || :active_record).to_sym
|
3
3
|
|
4
4
|
$:.unshift File.dirname(__FILE__)
|
5
5
|
puts "\n==> Devise.orm = #{DEVISE_ORM.inspect}"
|
@@ -11,7 +11,7 @@ require 'mocha/setup'
|
|
11
11
|
|
12
12
|
ActionMailer::Base.delivery_method = :test
|
13
13
|
ActionMailer::Base.perform_deliveries = true
|
14
|
-
ActionMailer::Base.default_url_options[:host] = '
|
14
|
+
ActionMailer::Base.default_url_options[:host] = 'example.com'
|
15
15
|
|
16
16
|
ActiveSupport::Deprecation.silenced = true
|
17
17
|
$VERBOSE = false
|
@@ -19,28 +19,15 @@ $VERBOSE = false
|
|
19
19
|
class ActionDispatch::IntegrationTest
|
20
20
|
include Capybara::DSL
|
21
21
|
end
|
22
|
+
|
22
23
|
class ActionController::TestCase
|
23
24
|
if defined? Devise::Test
|
24
25
|
include Devise::Test::ControllerHelpers
|
25
26
|
else
|
26
27
|
include Devise::TestHelpers
|
27
28
|
end
|
29
|
+
|
28
30
|
if defined? ActiveRecord
|
29
|
-
|
30
|
-
self.use_transactional_tests = true
|
31
|
-
else
|
32
|
-
begin
|
33
|
-
require 'test_after_commit'
|
34
|
-
self.use_transactional_fixtures = true
|
35
|
-
rescue LoadError
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
if Rails.version < '5.0.0'
|
41
|
-
def post(action, *args)
|
42
|
-
hash = args[0] || {}
|
43
|
-
super action, hash[:params], hash[:session], hash[:flash]
|
44
|
-
end
|
31
|
+
self.use_transactional_tests = true
|
45
32
|
end
|
46
33
|
end
|
metadata
CHANGED
@@ -1,57 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_invitable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergio Cambra
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: actionmailer
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
-
type: :
|
19
|
+
version: '5.0'
|
20
|
+
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '5.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: devise
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.
|
33
|
+
version: '4.6'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.
|
40
|
+
version: '4.6'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
48
|
-
type: :
|
47
|
+
version: '2.0'
|
48
|
+
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: '2.0'
|
55
55
|
description: It adds support for send invitations by email (it requires to be authenticated)
|
56
56
|
and accept the invitation by setting a password.
|
57
57
|
email:
|
@@ -69,7 +69,28 @@ files:
|
|
69
69
|
- app/views/devise/invitations/new.html.erb
|
70
70
|
- app/views/devise/mailer/invitation_instructions.html.erb
|
71
71
|
- app/views/devise/mailer/invitation_instructions.text.erb
|
72
|
+
- config/locales/ar.yml
|
73
|
+
- config/locales/da.yml
|
74
|
+
- config/locales/de.yml
|
72
75
|
- config/locales/en.yml
|
76
|
+
- config/locales/es.yml
|
77
|
+
- config/locales/et.yml
|
78
|
+
- config/locales/fa.yml
|
79
|
+
- config/locales/fr.yml
|
80
|
+
- config/locales/it.yml
|
81
|
+
- config/locales/ja.yml
|
82
|
+
- config/locales/ko.yml
|
83
|
+
- config/locales/nl.yml
|
84
|
+
- config/locales/no.yml
|
85
|
+
- config/locales/pl.yml
|
86
|
+
- config/locales/pt-BR.yml
|
87
|
+
- config/locales/pt.yml
|
88
|
+
- config/locales/ru.yml
|
89
|
+
- config/locales/tr.yml
|
90
|
+
- config/locales/ua.yml
|
91
|
+
- config/locales/vi.yml
|
92
|
+
- config/locales/zh-HK.yml
|
93
|
+
- config/locales/zh-TW.yml
|
73
94
|
- lib/devise_invitable.rb
|
74
95
|
- lib/devise_invitable/controllers/helpers.rb
|
75
96
|
- lib/devise_invitable/inviter.rb
|
@@ -121,6 +142,7 @@ files:
|
|
121
142
|
- test/rails_app/config.ru
|
122
143
|
- test/rails_app/config/application.rb
|
123
144
|
- test/rails_app/config/boot.rb
|
145
|
+
- test/rails_app/config/credentials.yml.enc
|
124
146
|
- test/rails_app/config/database.yml
|
125
147
|
- test/rails_app/config/environment.rb
|
126
148
|
- test/rails_app/config/environments/development.rb
|
@@ -135,6 +157,7 @@ files:
|
|
135
157
|
- test/rails_app/config/initializers/wrap_parameters.rb
|
136
158
|
- test/rails_app/config/locales/devise.en.yml
|
137
159
|
- test/rails_app/config/locales/en.yml
|
160
|
+
- test/rails_app/config/master.key
|
138
161
|
- test/rails_app/config/routes.rb
|
139
162
|
- test/rails_app/db/migrate/20100401102949_create_tables.rb
|
140
163
|
- test/rails_app/mongoid.yml
|
@@ -145,7 +168,7 @@ homepage: https://github.com/scambra/devise_invitable
|
|
145
168
|
licenses:
|
146
169
|
- MIT
|
147
170
|
metadata: {}
|
148
|
-
post_install_message:
|
171
|
+
post_install_message:
|
149
172
|
rdoc_options:
|
150
173
|
- "--main"
|
151
174
|
- README.rdoc
|
@@ -156,16 +179,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
156
179
|
requirements:
|
157
180
|
- - ">="
|
158
181
|
- !ruby/object:Gem::Version
|
159
|
-
version: 2.
|
182
|
+
version: 2.2.2
|
160
183
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
184
|
requirements:
|
162
185
|
- - ">="
|
163
186
|
- !ruby/object:Gem::Version
|
164
|
-
version:
|
187
|
+
version: '0'
|
165
188
|
requirements: []
|
166
|
-
|
167
|
-
|
168
|
-
signing_key:
|
189
|
+
rubygems_version: 3.0.8
|
190
|
+
signing_key:
|
169
191
|
specification_version: 4
|
170
192
|
summary: An invitation strategy for Devise
|
171
193
|
test_files:
|
@@ -201,6 +223,7 @@ test_files:
|
|
201
223
|
- test/rails_app/config.ru
|
202
224
|
- test/rails_app/config/application.rb
|
203
225
|
- test/rails_app/config/boot.rb
|
226
|
+
- test/rails_app/config/credentials.yml.enc
|
204
227
|
- test/rails_app/config/database.yml
|
205
228
|
- test/rails_app/config/environment.rb
|
206
229
|
- test/rails_app/config/environments/development.rb
|
@@ -215,6 +238,7 @@ test_files:
|
|
215
238
|
- test/rails_app/config/initializers/wrap_parameters.rb
|
216
239
|
- test/rails_app/config/locales/devise.en.yml
|
217
240
|
- test/rails_app/config/locales/en.yml
|
241
|
+
- test/rails_app/config/master.key
|
218
242
|
- test/rails_app/config/routes.rb
|
219
243
|
- test/rails_app/db/migrate/20100401102949_create_tables.rb
|
220
244
|
- test/rails_app/mongoid.yml
|