devise_autosigninable 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -9,13 +9,16 @@ Devise Autosigninable signs in a user based on an autosignin token (random hash
9
9
  If signed in user try to sign in with Devise Autosigninable he will be sign out firstly and than go to sign in.
10
10
  So if token is incorrect user will be signed out anyway.
11
11
 
12
- Devise Autosigninable compatible with Rails 2 and Rails 3.
12
+ Devise Autosigninable compatibile with Rails 2 and Rails 3
13
+
13
14
 
14
15
  Installation
15
16
  -----------
17
+
18
+
16
19
  * Add devise_autosigninable to Gemfile:
17
20
 
18
- `gem 'devise_autosigninable', '1.0.0'`
21
+ `gem 'devise_autosigininable', '1.0.0'`
19
22
 
20
23
  * Add :autosigninable to your Devise modules in model, for example:
21
24
 
@@ -1,5 +1,5 @@
1
1
  Description:
2
- Explain the generator
2
+ Generates for the model with the given NAME a migration file
3
3
 
4
4
  Example:
5
5
  ./script/generate devise_autosigninable Thing
@@ -12,7 +12,6 @@ module Devise
12
12
  # indicator to expire autosignin token
13
13
  mattr_accessor :autosignin_expire
14
14
  @@autosignin_expire = false
15
-
16
15
  end
17
16
  end
18
17
 
@@ -70,7 +69,7 @@ module Devise
70
69
 
71
70
 
72
71
  module ClassMethods
73
-
72
+
74
73
  RETRY_COUNT = 20
75
74
 
76
75
  # Generate autosignin tokens unless already exists and save the records.
@@ -104,7 +103,7 @@ module Devise
104
103
 
105
104
  # Authenticate a user based on authentication token.
106
105
  def authenticate_with_autosignin_token(attributes={})
107
- resource = find_by_id(attributes[self.to_s.foreign_key.to_sym])
106
+ resource = find_by_id(attributes[self.to_s.foreign_key.to_sym].to_i)
108
107
  if resource.try(:valid_for_autosignin_token_authentication?, attributes)
109
108
  resource
110
109
  else
@@ -1,3 +1,3 @@
1
1
  module DeviseAutosigninable
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -1,3 +1,4 @@
1
+ # DeviseAutosigninable
1
2
  require 'devise'
2
3
 
3
4
  begin
@@ -11,6 +12,7 @@ else
11
12
 
12
13
  end
13
14
 
15
+
14
16
  Devise.add_module :autosigninable,
15
17
  :strategy => true,
16
18
  :controller => :autosignin,
@@ -12,4 +12,4 @@ namespace :devise do
12
12
  args.model.camelize.constantize.reset_all_autosignin_tokens
13
13
  end
14
14
  end
15
- end
15
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_autosigninable
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andrey Deryabin
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-14 00:00:00 +04:00
18
+ date: 2011-09-27 00:00:00 +04:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -40,8 +40,6 @@ files:
40
40
  - generators/devise_autosigninable/USAGE
41
41
  - generators/devise_autosigninable/devise_autosigninable_generator.rb
42
42
  - generators/devise_autosigninable/templates/migration.rb
43
- - init.rb
44
- - install.rb
45
43
  - lib/devise_autosigninable.rb
46
44
  - lib/devise_autosigninable/model.rb
47
45
  - lib/devise_autosigninable/routes.rb
@@ -51,9 +49,6 @@ files:
51
49
  - lib/devise_autosigninable/view_helpers.rb
52
50
  - lib/tasks/devise_autosigninable.rake
53
51
  - rails/init.rb
54
- - test/devise_autosigninable_test.rb
55
- - test/test_helper.rb
56
- - uninstall.rb
57
52
  has_rdoc: true
58
53
  homepage: http://github.com/evilmartians/devise_autosigninable
59
54
  licenses: []
@@ -88,6 +83,5 @@ rubygems_version: 1.6.2
88
83
  signing_key:
89
84
  specification_version: 3
90
85
  summary: It adds support to be logged in by uniq link. It useful for mailing and access from admin panel.
91
- test_files:
92
- - test/devise_autosigninable_test.rb
93
- - test/test_helper.rb
86
+ test_files: []
87
+
data/init.rb DELETED
@@ -1 +0,0 @@
1
- # Include hook code here
data/install.rb DELETED
@@ -1 +0,0 @@
1
- # Install hook code here
@@ -1,8 +0,0 @@
1
- require 'test_helper'
2
-
3
- class DeviseAutosigninableTest < ActiveSupport::TestCase
4
- # Replace this with your real tests.
5
- test "the truth" do
6
- assert true
7
- end
8
- end
data/test/test_helper.rb DELETED
@@ -1,4 +0,0 @@
1
- require 'rubygems'
2
- require 'active_support'
3
- require 'active_support/test_case'
4
- require 'test/unit'
data/uninstall.rb DELETED
@@ -1 +0,0 @@
1
- # Uninstall hook code here