This is also posted at https://github.com/rails/rails/issues/16269 but I 
just wanted to get more peoples thoughts on if this is truly a bug or not.

In my migration I'm converting my posts table to use uuids instead of the 
default integers via something like the following:

...
create_table :posts_temp, id: :uuid do |t|
  t.string :title
  ...
end

post_temp_model = Class.new(ActiveRecord::Base) do
  self.table_name = :posts_temp
end

Post.all.each do |post|
  post_temp = post.dup.becomes(post_temp_model)
  binding.pry
  post_temp.name # => "foobar"
  post_temp.save # => true
  post_temp.reload
  post_temp.name # => nil
end
...

When running this and inspecting what post_temp.title is the value appears 
to be there. When callingpost_temp.reload and inspecting the title again 
however it's nil. It seems as though the value is not being saved to the 
database.

Is this a bug or am I doing something incorrectly here?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to