Skip to content
Browse files

changed references to Array#count to Array#length to get rid of error…

…s with at least some versions of java (see issue #19)
  • Loading branch information...
1 parent e7630ee commit 68f26f34bab03a792ba25a87f9e1d2506f9be020 Matt Zukowski committed Feb 4, 2010
View
2 lib/casserver/authenticators/sql.rb
@@ -82,7 +82,7 @@ def validate(credentials)
username_column = @options[:username_column] || 'username'
password_column = @options[:password_column] || 'password'
- $LOG.debug "#{self.class}: [#{user_model}] " + "Connection pool size: #{user_model.connection_pool.instance_variable_get(:@checked_out).count}/#{user_model.connection_pool.instance_variable_get(:@connections).count}"
+ $LOG.debug "#{self.class}: [#{user_model}] " + "Connection pool size: #{user_model.connection_pool.instance_variable_get(:@checked_out).length}/#{user_model.connection_pool.instance_variable_get(:@connections).length}"
results = user_model.find(:all, :conditions => ["#{username_column} = ? AND #{password_column} = ?", @username, @password])
user_model.connection_pool.checkin(user_model.connection)
View
2 lib/casserver/authenticators/sql_authlogic.rb
@@ -52,7 +52,7 @@ def validate(credentials)
password_column = @options[:password_column] || "crypted_password"
salt_column = @options[:salt_column]
- $LOG.debug "#{self.class}: [#{user_model}] " + "Connection pool size: #{user_model.connection_pool.instance_variable_get(:@checked_out).count}/#{user_model.connection_pool.instance_variable_get(:@connections).count}"
+ $LOG.debug "#{self.class}: [#{user_model}] " + "Connection pool size: #{user_model.connection_pool.instance_variable_get(:@checked_out).length}/#{user_model.connection_pool.instance_variable_get(:@connections).length}"
results = user_model.find(:all, :conditions => ["#{username_column} = ?", @username])
user_model.connection_pool.checkin(user_model.connection)
View
2 lib/casserver/authenticators/sql_encrypted.rb
@@ -54,7 +54,7 @@ def validate(credentials)
username_column = @options[:username_column] || "username"
encrypt_function = @options[:encrypt_function] || 'user.encrypted_password == Digest::SHA256.hexdigest("#{user.encryption_salt}::#{@password}")'
- $LOG.debug "#{self.class}: [#{user_model}] " + "Connection pool size: #{user_model.connection_pool.instance_variable_get(:@checked_out).count}/#{user_model.connection_pool.instance_variable_get(:@connections).count}"
+ $LOG.debug "#{self.class}: [#{user_model}] " + "Connection pool size: #{user_model.connection_pool.instance_variable_get(:@checked_out).length}/#{user_model.connection_pool.instance_variable_get(:@connections).length}"
results = user_model.find(:all, :conditions => ["#{username_column} = ?", @username])
user_model.connection_pool.checkin(user_model.connection)
View
2 lib/casserver/authenticators/sql_rest_auth.rb
@@ -28,7 +28,7 @@ def validate(credentials)
username_column = @options[:username_column] || "email"
- $LOG.debug "#{self.class}: [#{user_model}] " + "Connection pool size: #{user_model.connection_pool.instance_variable_get(:@checked_out).count}/#{user_model.connection_pool.instance_variable_get(:@connections).count}"
+ $LOG.debug "#{self.class}: [#{user_model}] " + "Connection pool size: #{user_model.connection_pool.instance_variable_get(:@checked_out).length}/#{user_model.connection_pool.instance_variable_get(:@connections).length}"
results = user_model.find(:all, :conditions => ["#{username_column} = ?", @username])
user_model.connection_pool.checkin(user_model.connection)

0 comments on commit 68f26f3

Please sign in to comment.
Something went wrong with that request. Please try again.