devise_deactivatable 0.2.7 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +42 -3
- data/app/controllers/devise/deactivate_controller.rb +14 -1
- data/lib/devise_deactivatable/version.rb +1 -1
- metadata +36 -60
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 79eb7cb4b271c2c244f98355602e186bb6f76e2e
|
4
|
+
data.tar.gz: 5644c2e9509bd54825e7dfef46eb129df9f0a7f3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7baaff8a242f7126288e82e3b05c49ab9afcbd975fe1e9d701ba1c3f2c4425f22177827e0e201e548a17d5c4f7d305f9415a93eba2132ce92b18014809b7d65b
|
7
|
+
data.tar.gz: 619a73b3c22bc7ff0a987e66190d2c4a46a985a524ef93ff1f77ac6cf73a36d2a074b2324bd58a6f620c8ad03ec1b7c9dd95bb1d31187ad200ca195b143629f5
|
data/README.md
CHANGED
@@ -1,4 +1,43 @@
|
|
1
|
-
|
2
|
-
====================
|
1
|
+
# Devise Deactivatable
|
3
2
|
|
4
|
-
|
3
|
+
Deactivatable Support for Devise
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
Add it to your Gemfile
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem "devise_deactivatable"
|
11
|
+
```
|
12
|
+
|
13
|
+
Add the `deactivatable` module to your model:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
class User < ActiveRecord::Base
|
17
|
+
devise :database_authenticatable, :deactivatable
|
18
|
+
end
|
19
|
+
```
|
20
|
+
|
21
|
+
And add the `deactivated_at` field to the database through a migration:
|
22
|
+
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
class DeviseCreateUsers < ActiveRecord::Migration
|
26
|
+
def change
|
27
|
+
add_column :users, :deactivated_at, :datetime
|
28
|
+
end
|
29
|
+
end
|
30
|
+
```
|
31
|
+
|
32
|
+
And you're ready to go!
|
33
|
+
|
34
|
+
## Contributing
|
35
|
+
|
36
|
+
* Fork it
|
37
|
+
* Write your changes
|
38
|
+
* Commit
|
39
|
+
* Send a pull request
|
40
|
+
|
41
|
+
## License
|
42
|
+
|
43
|
+
Apache License version 2. Copyright 2012-2014 Plataformatec http://plataformatec.com.br
|
@@ -5,14 +5,27 @@ class Devise::DeactivateController < DeviseController
|
|
5
5
|
def create
|
6
6
|
@resource = current_deactivatee
|
7
7
|
@resource.deactivate! if @resource
|
8
|
-
|
8
|
+
|
9
|
+
respond_to do |format|
|
10
|
+
format.json { head :ok }
|
11
|
+
format.any(*navigational_formats) { redirect_to after_deactivate_path_for(resource_name) }
|
12
|
+
end
|
9
13
|
rescue
|
10
14
|
respond_with @resource
|
11
15
|
end
|
12
16
|
|
17
|
+
def test
|
18
|
+
end
|
19
|
+
|
13
20
|
protected
|
14
21
|
|
15
22
|
def current_deactivatee
|
16
23
|
authenticate_deactivatee!
|
17
24
|
end
|
25
|
+
|
26
|
+
# The path used after deactivated
|
27
|
+
def after_deactivate_path_for(resource_name)
|
28
|
+
new_session_path(resource_name) if is_navigational_format?
|
29
|
+
end
|
30
|
+
|
18
31
|
end
|
metadata
CHANGED
@@ -1,49 +1,38 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_deactivatable
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
- 7
|
10
|
-
version: 0.2.7
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.0
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Elan Meng
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2014-06-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
22
14
|
name: devise
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
- - ">="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 7
|
30
|
-
segments:
|
31
|
-
- 3
|
32
|
-
- 0
|
33
|
-
- 0
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
34
19
|
version: 3.0.0
|
35
20
|
type: :runtime
|
36
|
-
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 3.0.0
|
37
27
|
description: Deactivate support for Devise.
|
38
|
-
email:
|
28
|
+
email:
|
39
29
|
- dreamwords@gmail.com
|
40
30
|
executables: []
|
41
|
-
|
42
31
|
extensions: []
|
43
|
-
|
44
32
|
extra_rdoc_files: []
|
45
|
-
|
46
|
-
|
33
|
+
files:
|
34
|
+
- LICENSE
|
35
|
+
- README.md
|
47
36
|
- app/controllers/devise/deactivate_controller.rb
|
48
37
|
- config/locales/en.yml
|
49
38
|
- lib/devise_deactivatable.rb
|
@@ -53,41 +42,28 @@ files:
|
|
53
42
|
- lib/devise_deactivatable/rails.rb
|
54
43
|
- lib/devise_deactivatable/routes.rb
|
55
44
|
- lib/devise_deactivatable/version.rb
|
56
|
-
- LICENSE
|
57
|
-
- README.md
|
58
|
-
has_rdoc: true
|
59
45
|
homepage: https://github.com/scambra/devise_invitable
|
60
|
-
licenses:
|
46
|
+
licenses:
|
61
47
|
- MIT
|
48
|
+
metadata: {}
|
62
49
|
post_install_message:
|
63
50
|
rdoc_options: []
|
64
|
-
|
65
|
-
require_paths:
|
51
|
+
require_paths:
|
66
52
|
- lib
|
67
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
none: false
|
78
|
-
requirements:
|
79
|
-
- - ">="
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
hash: 3
|
82
|
-
segments:
|
83
|
-
- 0
|
84
|
-
version: "0"
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - '>='
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
58
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
85
63
|
requirements: []
|
86
|
-
|
87
64
|
rubyforge_project:
|
88
|
-
rubygems_version:
|
65
|
+
rubygems_version: 2.2.2
|
89
66
|
signing_key:
|
90
|
-
specification_version:
|
67
|
+
specification_version: 4
|
91
68
|
summary: Deactivate support for Devise
|
92
69
|
test_files: []
|
93
|
-
|