compatibility with attr-accessible. inspired/thanks to @mhauserr