search for: keycase

Displaying 2 results from an estimated 2 matches for "keycase".

Did you mean: keybase
2008 Mar 12
1
Testing helper methods in rspec
...imple string manipulation function and I want to write some tests for it. It it were a script then I would just add if __FILE__ == $0 and add the tests below that but I do not feel that this is the best way to handle a rails helper. The code (I said it was simple) : module ApplicationHelper # keycase strips leading spaces, squeezes out extra whitespace # between words, downshifts all and then capitalizes the first # character of each word. # # This method prepares descriptive strings that are used # as indices for lookups. To preserve common initialisms insert # periods between let...
2008 May 23
20
Rails validation is inefficient
Hi, I have a User model, with a validates_uniqueness_of :login The generated SQL for the validation is: SELECT * FROM `users` WHERE (LOWER(users.login) = ''fernando'' AND users.id <> 10001) LIMIT 1; and it takes 0.13s to happen (my table has 10.000 rows) When I use the EXPLAIN instruction on it, it shows that it will use the primary_key as index, but this is not