See https://github.com/rails/rails/pull/5345 for https://github.com/rails/rails/issues/5381 for background.
AR models live somewhere between simple data structure (Hash) and domain objects with arbitrarily complex behavior.#5345 introduces slice to the model API, which makes it feel more like a data structure. I propose that:
each to iterate over the attributes hash with the declared methods (and their values) merged inThis would effectively allow users to pass AR models to any method that operates on a Hash.
Thoughts?