Compare commits

..

10 Commits
v2.1.1 ... v2.1

Author SHA1 Message Date
José Valim
8563f106a1 Release 2.1.4 2013-08-18 10:37:31 +02:00
Rafael Mendonça França
d9513e3bea Use the Ruby 1.8 hash syntax.
Yes we still support Ruby 1.8 😢

Conflicts:
	Gemfile.lock
2013-01-28 13:29:20 -02:00
José Valim
7dfbe6ff5c Release v2.1.3 2013-01-26 11:46:57 -07:00
José Valim
df96a80155 Require string conversion for all values 2013-01-26 11:44:52 -07:00
José Valim
174c2903d7 Release 2.1.2 2012-06-19 11:27:30 +02:00
José Valim
1f4c8e39f8 Revert "Thor fixes were sent upstream"
Actually, we need to wait for a new rails release, le sigh.

This reverts commit 3caab6d2ea.
2012-06-18 15:18:33 +02:00
José Valim
3caab6d2ea Thor fixes were sent upstream 2012-06-18 15:06:06 +02:00
José Valim
4e5a9bd600 Workaround thor bug /cc @wycats 2012-06-18 13:44:43 +02:00
José Valim
fef34d360b Merge pull request #1924 from calmyournerves/patch-1
fixed typo "Depreation" -> "Deprecation"
2012-06-16 11:00:38 -07:00
calmyournerves
05ddd9c204 fixed typo "Depreation" -> "Deprecation" 2012-06-16 20:51:56 +03:00
13 changed files with 83 additions and 77 deletions

View File

@@ -1,6 +1,22 @@
== 2.1.1
== 2.1.4
Notes: https://github.com/plataformatec/devise/wiki/How-to:-upgrade-to-devise-2.1
* bug fix
* Do not confirm account after reset password
== 2.1.3
* bug fix
* Require string conversion for all values
== 2.1.2
* Enhancements
* Handle backwards incompatibility between Rails 3.2.6 and Thor 0.15.x
* bug fix
* Fix regression on strategy validation on previous release
== 2.1.1 (yanked)
* enhancements
* `sign_out_all_scopes` now locks warden and does not allow new logins in the same action

View File

@@ -2,7 +2,7 @@ source "http://rubygems.org"
gemspec
gem "rails", "~> 3.2.3"
gem "rails", "~> 3.2.6"
gem "omniauth", "~> 1.0.0"
gem "omniauth-oauth2", "~> 1.0.0"
gem "rdoc"

View File

@@ -1,7 +1,7 @@
PATH
remote: .
specs:
devise (2.1.0)
devise (2.1.4)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.1)
railties (~> 3.1)
@@ -10,36 +10,36 @@ PATH
GEM
remote: http://rubygems.org/
specs:
actionmailer (3.2.3)
actionpack (= 3.2.3)
actionmailer (3.2.6)
actionpack (= 3.2.6)
mail (~> 2.4.4)
actionpack (3.2.3)
activemodel (= 3.2.3)
activesupport (= 3.2.3)
actionpack (3.2.6)
activemodel (= 3.2.6)
activesupport (= 3.2.6)
builder (~> 3.0.0)
erubis (~> 2.7.0)
journey (~> 1.0.1)
rack (~> 1.4.0)
rack-cache (~> 1.2)
rack-test (~> 0.6.1)
sprockets (~> 2.1.2)
activemodel (3.2.3)
activesupport (= 3.2.3)
sprockets (~> 2.1.3)
activemodel (3.2.6)
activesupport (= 3.2.6)
builder (~> 3.0.0)
activerecord (3.2.3)
activemodel (= 3.2.3)
activesupport (= 3.2.3)
activerecord (3.2.6)
activemodel (= 3.2.6)
activesupport (= 3.2.6)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activeresource (3.2.3)
activemodel (= 3.2.3)
activesupport (= 3.2.3)
activesupport (3.2.3)
activeresource (3.2.6)
activemodel (= 3.2.6)
activesupport (= 3.2.6)
activesupport (3.2.6)
i18n (~> 0.6)
multi_json (~> 1.0)
addressable (2.2.6)
arel (3.0.2)
bcrypt-ruby (3.0.1)
bcrypt-ruby (3.1.1)
bson (1.5.1)
bson_ext (1.3.1)
builder (3.0.0)
@@ -52,7 +52,7 @@ GEM
hashie (1.2.0)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.3)
journey (1.0.4)
json (1.7.3)
linecache (0.46)
rbx-require-relative (> 0.0.4)
@@ -87,7 +87,7 @@ GEM
omniauth-openid (1.0.1)
omniauth (~> 1.0)
rack-openid (~> 1.3.1)
orm_adapter (0.1.0)
orm_adapter (0.4.0)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
@@ -99,21 +99,21 @@ GEM
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.2.3)
actionmailer (= 3.2.3)
actionpack (= 3.2.3)
activerecord (= 3.2.3)
activeresource (= 3.2.3)
activesupport (= 3.2.3)
rails (3.2.6)
actionmailer (= 3.2.6)
actionpack (= 3.2.6)
activerecord (= 3.2.6)
activeresource (= 3.2.6)
activesupport (= 3.2.6)
bundler (~> 1.0)
railties (= 3.2.3)
railties (3.2.3)
actionpack (= 3.2.3)
activesupport (= 3.2.3)
railties (= 3.2.6)
railties (3.2.6)
actionpack (= 3.2.6)
activesupport (= 3.2.6)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
thor (>= 0.14.6, < 2.0)
rake (0.9.2.2)
rbx-require-relative (0.0.5)
rdoc (3.12)
@@ -129,13 +129,13 @@ GEM
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.5)
thor (0.14.6)
thor (0.15.2)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.33)
warden (1.2.1)
warden (1.2.3)
rack (>= 1.0)
webrat (0.7.2)
nokogiri (>= 1.2.0)
@@ -158,7 +158,7 @@ DEPENDENCIES
omniauth-facebook
omniauth-oauth2 (~> 1.0.0)
omniauth-openid (~> 1.0.1)
rails (~> 3.2.3)
rails (~> 3.2.6)
rdoc
ruby-debug (>= 0.10.3)
sqlite3

View File

@@ -1,11 +1,11 @@
PATH
remote: ..
specs:
devise (2.1.0.rc2)
devise (2.1.4)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.7)
orm_adapter (~> 0.1)
railties (~> 3.1)
warden (~> 1.1.1)
warden (~> 1.2.1)
GEM
remote: http://rubygems.org/
@@ -40,7 +40,7 @@ GEM
multi_json (~> 1.0)
addressable (2.2.7)
arel (2.2.3)
bcrypt-ruby (3.0.1)
bcrypt-ruby (3.1.1)
bson (1.5.2)
bson_ext (1.3.1)
builder (3.0.0)
@@ -87,7 +87,7 @@ GEM
omniauth-openid (1.0.1)
omniauth (~> 1.0)
rack-openid (~> 1.3.1)
orm_adapter (0.0.7)
orm_adapter (0.4.0)
polyglot (0.3.3)
rack (1.3.6)
rack-cache (1.2)
@@ -137,7 +137,7 @@ GEM
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.33)
warden (1.1.1)
warden (1.2.3)
rack (>= 1.0)
webrat (0.7.2)
nokogiri (>= 1.2.0)

View File

@@ -205,21 +205,20 @@ module Devise
# namedscope to filter records while authenticating.
# Example:
#
# def self.find_for_authentication(conditions={})
# conditions[:active] = true
# super
# def self.find_for_authentication(tainted_conditions)
# find_first_by_auth_conditions(tainted_conditions, :active => true)
# end
#
# Finally, notice that Devise also queries for users in other scenarios
# besides authentication, for example when retrieving an user to send
# an e-mail for password reset. In such cases, find_for_authentication
# is not called.
def find_for_authentication(conditions)
find_first_by_auth_conditions(conditions)
def find_for_authentication(tainted_conditions)
find_first_by_auth_conditions(tainted_conditions)
end
def find_first_by_auth_conditions(conditions)
to_adapter.find_first devise_param_filter.filter(conditions)
def find_first_by_auth_conditions(tainted_conditions, opts={})
to_adapter.find_first(devise_param_filter.filter(tainted_conditions).merge(opts))
end
# Find an initialize a record setting an error if it can't be found.

View File

@@ -177,11 +177,6 @@ module Devise
generate_confirmation_token && save(:validate => false)
end
def after_password_reset
super
confirm! unless confirmed?
end
def postpone_email_change_until_confirmation
@reconfirmation_required = true
self.unconfirmed_email = self.email

View File

@@ -33,9 +33,8 @@ module Devise
private
# Determine which values should be transformed to string or passed as-is to the query builder underneath
def param_requires_string_conversion?(value)
[Fixnum, TrueClass, FalseClass, Regexp].none? {|clz| value.is_a? clz }
true
end
end
end

View File

@@ -27,7 +27,7 @@ module Devise
# unauthenticated_message.
def validate(resource, &block)
unless resource
ActiveSupport::Depreation.warn "an empty resource was given to #{self.class.name}#validate. " \
ActiveSupport::Deprecation.warn "an empty resource was given to #{self.class.name}#validate. " \
"Please ensure the resource is not nil", caller
end

View File

@@ -1,3 +1,3 @@
module Devise
VERSION = "2.1.1".freeze
VERSION = "2.1.4".freeze
end

View File

@@ -10,6 +10,11 @@ module Devise
argument :scope, :required => false, :default => nil,
:desc => "The scope to copy views to"
# Le sigh, ensure Thor won't handle opts as args
# It should be fixed in future Rails releases
class_option :form_builder, :aliases => "-b"
class_option :markerb
public_task :copy_views
end
@@ -98,6 +103,7 @@ module Devise
:desc => "The scope to copy views to"
invoke SharedViewsGenerator
hook_for :form_builder, :aliases => "-b",
:desc => "Form builder to be used",
:default => defined?(SimpleForm) ? "simple_form_for" : "form_for"

View File

@@ -201,15 +201,6 @@ class PasswordTest < ActionController::IntegrationTest
assert !warden.authenticated?(:user)
end
test 'sign in user automatically and confirm after changing its password if it\'s not confirmed' do
user = create_user(:confirm => false)
request_forgot_password
reset_password :reset_password_token => user.reload.reset_password_token
assert warden.authenticated?(:user)
assert user.reload.confirmed?
end
test 'reset password request with valid E-Mail in XML format should return valid response' do
create_user
post user_password_path(:format => 'xml'), :user => {:email => "user@test.com"}

View File

@@ -4,4 +4,10 @@ class AuthenticatableTest < ActiveSupport::TestCase
test 'required_fields should be an empty array' do
assert_equal Devise::Models::Validatable.required_fields(User), []
end
end
test 'find_first_by_auth_conditions allows custom filtering parameters' do
user = User.create!(:email => "example@example.com", :password => "123456")
assert_equal User.find_first_by_auth_conditions({ :email => "example@example.com" }), user
assert_equal User.find_first_by_auth_conditions({ :email => "example@example.com" }, :id => user.id + 1), nil
end
end

View File

@@ -23,15 +23,9 @@ class DatabaseAuthenticatableTest < ActiveSupport::TestCase
end
test "param filter should not convert booleans and integer to strings" do
conditions = { 'login' => 'foo@bar.com', "bool1" => true, "bool2" => false, "fixnum" => 123, "will_be_converted" => (1..10) }
conditions = { "login" => "foo@bar.com", "bool1" => true, "bool2" => false, "fixnum" => 123, "will_be_converted" => (1..10) }
conditions = Devise::ParamFilter.new([], []).filter(conditions)
assert_equal( { 'login' => 'foo@bar.com', "bool1" => true, "bool2" => false, "fixnum" => 123, "will_be_converted" => "1..10" }, conditions)
end
test "param filter should not convert regular expressions to strings" do
conditions = { "regexp" => /expression/ }
conditions = Devise::ParamFilter.new([], []).filter(conditions)
assert_equal( { "regexp" => /expression/ }, conditions)
assert_equal( { "login" => "foo@bar.com", "bool1" => "true", "bool2" => "false", "fixnum" => "123", "will_be_converted" => "1..10" }, conditions)
end
test 'should respond to password and password confirmation' do
@@ -186,4 +180,4 @@ class DatabaseAuthenticatableTest < ActiveSupport::TestCase
]
end
end
end
end