Fixed Attribute Inheritance Issue 

See https://github.com/rails/rails/issues/14672

Slightly modified the patch made by @bradleyjucsc, should pass all tests.
@matthewd, let me know if you think any more cleanup should be done.