From bfa65dde70c33a29977f471297de71498d93f90b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Mon, 28 Jan 2013 13:21:44 -0200 Subject: [PATCH] Use the Ruby 1.8 hash syntax. Yes we still support Ruby 1.8 :cry: --- Gemfile.lock | 2 +- lib/devise/models/authenticatable.rb | 2 +- test/models/authenticatable_test.rb | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index abf1441c..4a44ca0c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - devise (2.2.2) + devise (2.2.3) bcrypt-ruby (~> 3.0) orm_adapter (~> 0.1) railties (~> 3.1) diff --git a/lib/devise/models/authenticatable.rb b/lib/devise/models/authenticatable.rb index 74737fe6..e01ebb38 100644 --- a/lib/devise/models/authenticatable.rb +++ b/lib/devise/models/authenticatable.rb @@ -215,7 +215,7 @@ module Devise # Example: # # 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 # # Finally, notice that Devise also queries for users in other scenarios diff --git a/test/models/authenticatable_test.rb b/test/models/authenticatable_test.rb index d651bc40..6c1529be 100644 --- a/test/models/authenticatable_test.rb +++ b/test/models/authenticatable_test.rb @@ -6,8 +6,8 @@ class AuthenticatableTest < ActiveSupport::TestCase 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 + 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