bug fix: undefined method to_js.

when try to convert to json a factory with association, this raises a exception with message “undefined method `to_js' for…”