[openstreetmap-website] User menu structure refactor (#61)

Tom Hughes notifications at github.com
Wed Aug 8 21:13:48 BST 2012


The migration should use the new date stamped format, not the old serial number format for the name - if you use `rails g migration` to create new migrations then it will take care of that.

Rather than having to hold lists of all the changesets and traces in memory in the migration I would suggest doing something like this:

```ruby
Changeset.group(:user_id).pluck(:user_id).each do |user_id|
  User.reset_counters(user_id, :changesets)
end
```

and the equivalent for traces. That way only an array of user ids will need to be held in memory.

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/61#issuecomment-7595886
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20120808/fc1ac1a2/attachment.html>


More information about the rails-dev mailing list