Solutions for technical interview questions at Planning Center Online. Topics discussed are jQuery, Rails w/ SQL, and Ruby classes
- Updated Method since JQuery 1.7
- Replaced die() and live() methods with new off() and on().
- Added event.preventDefault() to stop default action from clicking element
- Added has_many to complete table association
- Also added inverse_of option to keep models in sync.
- Removed posibility of SQL injection by removing the argument from the conditions string. (It was previously unescaped and would be sent to the database as is.)
- Replaced the ".each" method with ".find_each".
- The ".each" method becomes more impractical as the table size increases, as it could return the entire table in a single pass.
- The ".find_each" method divides records into memory-friendly batches for processing, until all records are processed.
Here are the highlights! (See comments in code for full explanation)
- Used regex for Test::Unit asset_match and assert_no_match
- Test::Unit Assertion docs. Surprisingly simple.
- Had to include path to .rb files in parent directory with "-I dir" to get tests to run
- Gave me some clues on custom comparable methods
- Method help, link to enumerable module
- Showed me destructive sort! (which was what I wanted)