devise 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of devise might be problematic. Click here for more details.
- data/CHANGELOG.rdoc +6 -0
- data/lib/devise/mapping.rb +4 -8
- data/lib/devise/models/authenticatable.rb +1 -1
- data/lib/devise/schema.rb +2 -2
- data/lib/devise/version.rb +1 -1
- data/test/mapping_test.rb +12 -12
- metadata +2 -2
data/CHANGELOG.rdoc
CHANGED
data/lib/devise/mapping.rb
CHANGED
@@ -92,24 +92,20 @@ module Devise
|
|
92
92
|
self.path_prefix.count("/")
|
93
93
|
end
|
94
94
|
|
95
|
-
# Returns the raw path using
|
95
|
+
# Returns the raw path using path_prefix and as.
|
96
96
|
def raw_path
|
97
|
-
|
97
|
+
path_prefix + as.to_s
|
98
98
|
end
|
99
99
|
|
100
|
-
# Returns the parsed path
|
101
|
-
# you should overwrite this method to use it. The only information supported
|
102
|
-
# by default is I18n.locale.
|
103
|
-
#
|
100
|
+
# Returns the parsed path taking into account the relative url root and raw path.
|
104
101
|
def parsed_path
|
105
|
-
returning raw_path do |path|
|
102
|
+
returning (ActionController::Base.relative_url_root.to_s + raw_path) do |path|
|
106
103
|
self.class.default_url_options.each do |key, value|
|
107
104
|
path.gsub!(key.inspect, value.to_param)
|
108
105
|
end
|
109
106
|
end
|
110
107
|
end
|
111
108
|
|
112
|
-
|
113
109
|
# Create magic predicates for verifying what module is activated by this map.
|
114
110
|
# Example:
|
115
111
|
#
|
@@ -71,7 +71,7 @@ module Devise
|
|
71
71
|
|
72
72
|
# Digests the password using the configured encryptor.
|
73
73
|
def password_digest(password)
|
74
|
-
self.class.encryptor_class.digest(password, self.class.stretches, password_salt, self.class.pepper)
|
74
|
+
self.class.encryptor_class.digest(password, self.class.stretches, self.password_salt, self.class.pepper)
|
75
75
|
end
|
76
76
|
|
77
77
|
module ClassMethods
|
data/lib/devise/schema.rb
CHANGED
@@ -12,9 +12,9 @@ module Devise
|
|
12
12
|
null = options[:null] || false
|
13
13
|
encryptor = options[:encryptor] || (respond_to?(:encryptor) ? self.encryptor : :sha1)
|
14
14
|
|
15
|
-
apply_schema :email, String, :null => null
|
15
|
+
apply_schema :email, String, :null => null
|
16
16
|
apply_schema :encrypted_password, String, :null => null, :limit => Devise::ENCRYPTORS_LENGTH[encryptor]
|
17
|
-
apply_schema :password_salt, String, :null => null
|
17
|
+
apply_schema :password_salt, String, :null => null
|
18
18
|
end
|
19
19
|
|
20
20
|
# Creates confirmation_token, confirmed_at and confirmation_sent_at.
|
data/lib/devise/version.rb
CHANGED
data/test/mapping_test.rb
CHANGED
@@ -97,18 +97,12 @@ class MappingTest < ActiveSupport::TestCase
|
|
97
97
|
assert_equal '/:locale/accounts', Devise.mappings[:manager].raw_path
|
98
98
|
end
|
99
99
|
|
100
|
-
test 'raw path
|
101
|
-
swap ActionController::Base, :relative_url_root =>
|
102
|
-
assert_equal '/abc/users', Devise.mappings[:user].raw_path
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
test 'raw path deals with a nil relative_url_root' do
|
107
|
-
swap ActionController::Base, :relative_url_root => nil do
|
100
|
+
test 'raw path ignores the relative_url_root' do
|
101
|
+
swap ActionController::Base, :relative_url_root => "/abc" do
|
108
102
|
assert_equal '/users', Devise.mappings[:user].raw_path
|
109
103
|
end
|
110
104
|
end
|
111
|
-
|
105
|
+
|
112
106
|
test 'parsed path is returned' do
|
113
107
|
begin
|
114
108
|
Devise.default_url_options {{ :locale => I18n.locale }}
|
@@ -119,12 +113,18 @@ class MappingTest < ActiveSupport::TestCase
|
|
119
113
|
end
|
120
114
|
end
|
121
115
|
|
122
|
-
test 'parsed path
|
123
|
-
swap ActionController::Base, :relative_url_root =>
|
116
|
+
test 'parsed path adds in the relative_url_root' do
|
117
|
+
swap ActionController::Base, :relative_url_root => '/abc' do
|
124
118
|
assert_equal '/abc/users', Devise.mappings[:user].parsed_path
|
125
119
|
end
|
126
120
|
end
|
127
|
-
|
121
|
+
|
122
|
+
test 'parsed path deals with a nil relative_url_root' do
|
123
|
+
swap ActionController::Base, :relative_url_root => nil do
|
124
|
+
assert_equal '/users', Devise.mappings[:user].raw_path
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
128
|
test 'should have default route options' do
|
129
129
|
assert_equal({}, Devise.mappings[:user].route_options)
|
130
130
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Jos\xC3\xA9 Valim"
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2010-01-
|
13
|
+
date: 2010-01-25 00:00:00 +01:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|