It is likely that he is getting all records back (as shown by #count)
and that 138 is the lowest id.
Nope:)
The reason I noticed is that when I did a find all I wasn’t getting new
records that had been added.
However, if I get the new records by their id they definitely exist.
It’s got odder this morning, there are now 155 records, and a find all
returns the latest records, however records id 139 to 145 are missing!
Again, I can get them by id.
But using Webmin to list the records, I get exactly the same result - so
it is looking like a database issue.
On Monday, July 8, 2013 5:26:15 AM UTC-4, Ruby-Forum.com User wrote:
I’ve been trying but am unable to duplicate your problem. I’m running
on
rails4 with postgresql9.1 and pg (0.15.1). Here’s my simple test:
rails new CheckItOut -d postgresql
cd CheckItOut
rails generate scaffold Number name:string value:integer
rake db:create
rake db:migrate
rails console
n = 0
while (n < 200) {
name = sprintf(“%04d”, n)
Number.create(:name => name, :value => n)
n += 1 }
rails server
browsing to localhost:3000/numbers shows an index with 200 entries of
the expected names and values
Try these steps to see if you really have the database problem as you’ve
reported it or if what you’re seeing is a result of something lurking in
your app.