rails/rails — pull request #13533 by kuldeepaggarwal (2013-12-29 18:24:31+00:00)
Title: allow user to set virtual attributes with becomes/becomes!

Previously `Model#becomes` and `Model#becomes!` sets only those values which are `persisted` in the database but with this PR, they will be able to pass a list of `virtual attributes` to `Model#becomes` that needs to set. like:

```ruby
class Company < ActiveRecord::Base
attr_accessor :alias_name
end

# Before
company = Company.new(name: '37signals', alias_name: 'Rails')
client = company.becomes(Client)
client.alias_name # => nil

# After
company = Company.new(name: '37signals', alias_name: 'Rails')
client = company.becomes(Client, :alias_name)
client.alias_name # => 'Rails'

```