Alias base_klass to active_record on JoinBase.
Indent to align columns for readability
Improve code readability
Improve code readability and error message
Compatibility with Rails commit 743b675 of July 16, 2013

https://github.com/rails/rails/commit/743b67508e2027e1d086142ccbec47a19f
c943f6