rails/rails — pull request #15300 by arthurnn (2014-05-24 19:02:01+00:00)
Title: Refactor reflections

Continuation of #15210. This is suppose to go to master.

### What I did in here:
- cherry picked the merge commit of #15210 that went to 4-1-stable
- Fixed some small spots that were failing, because 4.1 didnt have the keys on the reflection map as strings.
- remove `class_attribute :reflections` from `Reflection` module. This is the most important commit in here, what I did was instead of having 2 internal reflection hashes, now we have only the private one, and a public method `reflections`, which returns a list of public representation of the reflections.

review @tenderlove @rafaelfranca @matthewd

IMO , last commit a2d90c6 could be cherry-picked into 4-1-stable too, as this doesnt change public API, it only adds a new attribute to the `AssociationReflection`

### Future work
Make the public reflections representations frozen, so people cannot mutate them.