mm-devise 1.3 → 2.0
Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile
CHANGED
@@ -2,22 +2,25 @@ source :rubygems
|
|
2
2
|
|
3
3
|
group :test do
|
4
4
|
gem "test-unit", "~> 2.0.9"
|
5
|
-
gem "webrat", "~> 0.7.
|
5
|
+
gem "webrat", "~> 0.7.0"
|
6
6
|
gem "mocha", "~> 0.9.8", :require => false
|
7
7
|
end
|
8
8
|
|
9
9
|
group :default do
|
10
|
-
gem "rails", "~> 3.0
|
11
|
-
gem "webrat", "~> 0.7.
|
10
|
+
gem "rails", "~> 3.2.0"
|
11
|
+
gem "webrat", "~> 0.7.0"
|
12
12
|
|
13
|
-
gem 'mongo_mapper', '~> 0.
|
14
|
-
gem 'devise', '>= 1.
|
13
|
+
gem 'mongo_mapper', '~> 0.11.0'
|
14
|
+
gem 'devise', '>= 2.1.0'
|
15
|
+
gem 'devise-encryptable'
|
15
16
|
gem 'bson_ext', '>= 1.2.0'
|
16
17
|
|
17
18
|
gem 'rake', '>= 0.8.7'
|
18
19
|
gem "orm_adapter"
|
19
|
-
gem "oa-oauth", '~> 0.
|
20
|
-
gem "oa-openid", '~> 0.
|
20
|
+
#gem "oa-oauth", '~> 0.3.0', :require => "omniauth/oauth"
|
21
|
+
#gem "oa-openid", '~> 0.3.0', :require => "omniauth/openid"
|
22
|
+
gem "omniauth-openid", '~>1.0.0'
|
23
|
+
gem "omniauth-facebook", '~>1.2.0'
|
21
24
|
|
22
25
|
platforms :mri_18 do
|
23
26
|
gem "SystemTimer"
|
@@ -1,37 +1,5 @@
|
|
1
1
|
require 'orm_adapter/adapters/mongo_mapper'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
module MongoMapper
|
6
|
-
extend ActiveSupport::Concern
|
3
|
+
#MongoMapper::Document.plugin Devise::Orm::MongoMapper
|
4
|
+
MongoMapper::Document::ClassMethods.send :include, Devise::Models
|
7
5
|
|
8
|
-
included do
|
9
|
-
extend Devise::Models
|
10
|
-
extend Devise::Orm::MongoMapper::Hook
|
11
|
-
end
|
12
|
-
|
13
|
-
module Hook
|
14
|
-
def devise_modules_hook!
|
15
|
-
extend Schema
|
16
|
-
yield
|
17
|
-
return unless Devise.apply_schema
|
18
|
-
devise_modules.each { |m| send(m) if respond_to?(m, true) }
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
22
|
-
|
23
|
-
module Schema
|
24
|
-
include Devise::Schema
|
25
|
-
|
26
|
-
# Tell how to apply schema methods
|
27
|
-
def apply_devise_schema(name, type, options={})
|
28
|
-
type = Time if type == DateTime
|
29
|
-
key(name, type, options)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
MongoMapper::Document.plugin Devise::Orm::MongoMapper
|
data/lib/mm-devise/version.rb
CHANGED
@@ -5,6 +5,25 @@ class Admin
|
|
5
5
|
include Shim
|
6
6
|
include SharedAdmin
|
7
7
|
|
8
|
-
|
8
|
+
## Database authenticatable
|
9
|
+
key :email, String, :null => true
|
10
|
+
key :encrypted_password, String, :null => true
|
11
|
+
|
12
|
+
## Recoverable
|
13
|
+
key :reset_password_token, String
|
14
|
+
key :reset_password_sent_at, Time
|
15
|
+
|
16
|
+
## Rememberable
|
17
|
+
key :remember_created_at, Time
|
18
|
+
|
19
|
+
## Confirmable
|
20
|
+
key :confirmation_token, String
|
21
|
+
key :confirmed_at, Time
|
22
|
+
key :confirmation_sent_at, Time
|
23
|
+
key :unconfirmed_email, String
|
24
|
+
|
25
|
+
## Lockable
|
26
|
+
key :locked_at, Time
|
27
|
+
|
9
28
|
timestamps!
|
10
29
|
end
|
@@ -4,4 +4,21 @@ module Shim
|
|
4
4
|
included do
|
5
5
|
self.include_root_in_json = true
|
6
6
|
end
|
7
|
+
#
|
8
|
+
|
9
|
+
module ClassMethods
|
10
|
+
def last(options={})
|
11
|
+
options.delete(:order) if options[:order] == "id"
|
12
|
+
super(options)
|
13
|
+
end
|
14
|
+
|
15
|
+
def find_by_email(email)
|
16
|
+
first(:conditions => { :email => email })
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
# overwrite equality (because some devise tests use this for asserting model equality)
|
21
|
+
def ==(other)
|
22
|
+
other.is_a?(self.class) && _id == other._id
|
23
|
+
end
|
7
24
|
end
|
@@ -7,5 +7,37 @@ class User
|
|
7
7
|
|
8
8
|
key :username, String
|
9
9
|
key :facebook_token, String
|
10
|
+
|
11
|
+
## Database authenticatable
|
12
|
+
key :email, String, :null => false, :default => ""
|
13
|
+
key :encrypted_password, String, :null => false, :default => ""
|
14
|
+
|
15
|
+
## Recoverable
|
16
|
+
key :reset_password_token, String
|
17
|
+
key :reset_password_sent_at, Time
|
18
|
+
|
19
|
+
## Rememberable
|
20
|
+
key :remember_created_at, Time
|
21
|
+
|
22
|
+
## Trackable
|
23
|
+
key :sign_in_count, Integer, :default => 0
|
24
|
+
key :current_sign_in_at, Time
|
25
|
+
key :last_sign_in_at, Time
|
26
|
+
key :current_sign_in_ip, String
|
27
|
+
key :last_sign_in_ip, String
|
28
|
+
|
29
|
+
## Confirmable
|
30
|
+
key :confirmation_token, String
|
31
|
+
key :confirmed_at, Time
|
32
|
+
key :confirmation_sent_at, Time
|
33
|
+
|
34
|
+
## Lockable
|
35
|
+
key :failed_attempts, Integer, :default => 0
|
36
|
+
key :locked_at, Time
|
37
|
+
key :unlock_token, String
|
38
|
+
|
39
|
+
## Token authenticatable
|
40
|
+
key :authentication_token, String
|
41
|
+
|
10
42
|
timestamps!
|
11
43
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mm-devise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '
|
4
|
+
version: '2.0'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-06-01 00:00:00.
|
12
|
+
date: 2011-06-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mongo_mapper
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: 0.9.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.9.0
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: devise
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,7 +37,12 @@ dependencies:
|
|
32
37
|
version: '1.2'
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '1.2'
|
36
46
|
description: dm-devise adds MongoMapper support to devise (http://github.com/plataformatec/devise)
|
37
47
|
for authentication support for Rails
|
38
48
|
email: kmandrup@gmail.com
|
@@ -77,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
87
|
version: '0'
|
78
88
|
requirements: []
|
79
89
|
rubyforge_project:
|
80
|
-
rubygems_version: 1.8.
|
90
|
+
rubygems_version: 1.8.24
|
81
91
|
signing_key:
|
82
92
|
specification_version: 3
|
83
93
|
summary: Support for using MongoMapper ORM with devise
|
@@ -90,3 +100,4 @@ test_files:
|
|
90
100
|
- test/rails_app/config/application.rb
|
91
101
|
- test/rails_app/config/environment.rb
|
92
102
|
- test/test_helper.rb
|
103
|
+
has_rdoc:
|