Fixed a ActiveRecord bug

Fixed a bug where you couldn't retrieve a referenced model.