Fixed NoMethodError for in attributes=/assign_attributes.

- Because sometimes objects other than a Hash are passed in, things go
  boom. This resolves that problem.
- Please see http://apidock.com/rails/ActiveRecord/Base/attributes%3D
  for more info.