Use the Ruby 1.8 hash syntax.

Yes we still support Ruby 1.8 😢
This commit is contained in:
Rafael Mendonça França 2013-01-28 13:21:44 -02:00
parent d099d8f0ac
commit bfa65dde70
3 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,7 @@
PATH PATH
remote: . remote: .
specs: specs:
devise (2.2.2) devise (2.2.3)
bcrypt-ruby (~> 3.0) bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.1) orm_adapter (~> 0.1)
railties (~> 3.1) railties (~> 3.1)

View File

@ -215,7 +215,7 @@ module Devise
# Example: # Example:
# #
# def self.find_for_authentication(tainted_conditions) # def self.find_for_authentication(tainted_conditions)
# find_first_by_auth_conditions(tainted_conditions, active: true) # find_first_by_auth_conditions(tainted_conditions, :active => true)
# end # end
# #
# Finally, notice that Devise also queries for users in other scenarios # Finally, notice that Devise also queries for users in other scenarios

View File

@ -6,8 +6,8 @@ class AuthenticatableTest < ActiveSupport::TestCase
end end
test 'find_first_by_auth_conditions allows custom filtering parameters' do test 'find_first_by_auth_conditions allows custom filtering parameters' do
user = User.create!(email: "example@example.com", password: "123456") 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" }), user
assert_equal User.find_first_by_auth_conditions({ email: "example@example.com" }, id: user.id + 1), nil assert_equal User.find_first_by_auth_conditions({ :email => "example@example.com" }, :id => user.id + 1), nil
end end
end end