-
Notifications
You must be signed in to change notification settings - Fork 22k
Closed
Labels
Description
Steps to reproduce
- Create a rails app with Rails 4.2 with PostgreSQL database.
- Configure a PostgreSQL database and enable
uuid-ossp. - Create a
bookstable withidbeing a UUID. Create some records manually. rails g model book- In
rails c.
[vagrant@localhost vagrant]$ rails c
Loading development environment (Rails 4.2.6)
[1] pry(main)> b = Book.first
Book Load (13.2ms) SELECT "books".* FROM "books" LIMIT 1
=> #<Book:0x007fd5a13d4068
id: nil,
...>
[2] pry(main)> b.attributes
=> {"id"=>"bfaae356-3f40-7ffc-30cc-bf5d9c95ffab",
...}
[3] pry(main)>
Expected behavior
b.id to be equal to bfaae356-3f40-7ffc-30cc-bf5d9c95ffab
Actual behavior
b.id is null
But attributes['id'] has the correct value.
System configuration
Rails version:
4.2.6 (also happens with 5.0.0.beta4)
Ruby version:
2.3.1