Use Ruby on Rails Coding Conventions for code examples in the guides

* Indent after private/protected
* Ruby >= 1.9 syntax for hashes
* Prefer method { do_stuff } instead of method{do_stuff} for single-line blocks.

[ci skip]
hm:t join tables may not have a primary key
Merge pull request #12155 from jetthoughts/reformat_guides_code_examples

Use Ruby on Rails Coding Conventions for code examples in the guides
Fix fixtures regression that required table names to map to classes only, not class names